@beyond-js/config
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -5,3 +5,3 @@ { | ||
"email": "hello@beyondjs.com", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"license": "MIT", | ||
@@ -8,0 +8,0 @@ "repository": "https://github.com/beyondjs/config", |
const DynamicProcessor = require('@beyond-js/dynamic-processor')(); | ||
const equal = require('@beyond-js/equal'); | ||
const PropertyFile = require('./file'); | ||
@@ -61,2 +62,4 @@ // The autoincrement is just to have an id in the config objects that is useful in development to trace the code | ||
#file; | ||
// The original configured data | ||
@@ -148,5 +151,5 @@ // (can be the string that points to the configuration file, an object, or an array of configurations) | ||
(() => { | ||
if (!this.children.has('file')) return; | ||
if (!this.#file) return; | ||
const file = this.children.get('file').child; | ||
const file = this.#file; | ||
const root = this.#parent ? this.#parent.path : this.#rootPath; | ||
@@ -161,6 +164,6 @@ if (file.root === root || file.relative === this.#data) return; | ||
(() => { | ||
if (this.children.has('file') || typeof this.#data !== 'string') return; | ||
if (this.#file || typeof this.#data !== 'string') return; | ||
const root = this.#parent ? this.#parent.path : this.#rootPath; | ||
const file = new (require('./file'))(root, this.#data); | ||
const file = this.#file = new PropertyFile(root, this.#data); | ||
this.children.register(new Map([['file', {child: file}]])); | ||
@@ -183,3 +186,3 @@ })(); | ||
else if (typeof this.#data === 'string') { | ||
const file = this.children.get('file').child; | ||
const file = this.#file; | ||
const {errors, value} = file; | ||
@@ -194,2 +197,6 @@ return done({errors, value}); | ||
} | ||
destroy() { | ||
this.#file?.destroy(); | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17944
500