This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Find property path in the object with a value | |
* @param {object} obj | |
* @param {any} value | |
* @return {string} | |
*/ | |
function findPropertyPathWithValue(obj, value) { | |
for (const key in obj) { | |
if (JSON.stringify(value) === JSON.stringify(obj[key])) { | |
return key; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get the object value by path | |
* @param {object} obj | |
* @param {string} path | |
* @return {any} | |
* @example | |
* getObjectValue({ str: 'string', int: 0 }, 'str'); //=> 'string' | |
* getObjectValue({ obj: { str: 'string', int: 0 } }, 'obj.str'); //=> 'string' | |
* getObjectValue({ arr: [{ str: 'string', int: 0 }] }, 'obj[0].str'); //=> 'string' | |
* getObjectValue({ arr: [{ str: 'string', int: 0 }] }, 'obj[*].str'); //=> ['string'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.8' | |
services: | |
elasticsearch: | |
container_name: es | |
image: docker.elastic.co/elasticsearch/elasticsearch:8.4.3 | |
environment: | |
- xpack.security.enabled=false | |
- "discovery.type=single-node" | |
networks: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM httpd:2.4 | |
COPY httpd.conf /usr/local/apache2/conf/httpd.conf | |
COPY index.html /usr/local/apache2/htdocs/index.html | |
RUN apt-get update \ | |
&& apt-get -y install openssl \ | |
&& cd /usr/local/apache2/conf \ | |
&& openssl req -new -newkey rsa:2048 -days 365 -nodes -x509 -keyout server.key -out server.crt -subj '/CN=localhost' |