config 4.4.0 → 4.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config-4.4.1.tgz +0 -0
- package/lib/config.js +5 -5
- package/lib/util.js +1 -2
- package/package.json +1 -1
- package/types/lib/config.d.ts +4 -4
- package/types/lib/util.d.ts +2 -3
package/config-4.4.1.tgz
ADDED
|
Binary file
|
package/lib/config.js
CHANGED
|
@@ -526,7 +526,7 @@ class ConfigUtils {
|
|
|
526
526
|
*
|
|
527
527
|
* @method attachProtoDeep
|
|
528
528
|
* @param {object} toObject
|
|
529
|
-
* @param {number
|
|
529
|
+
* @param {number} [depth=20]
|
|
530
530
|
* @return {object}
|
|
531
531
|
*/
|
|
532
532
|
attachProtoDeep(toObject, depth = DEFAULT_CLONE_DEPTH) {
|
|
@@ -579,16 +579,16 @@ class ConfigUtils {
|
|
|
579
579
|
/**
|
|
580
580
|
* Returns a new deep copy of the current config object, or any part of the config if provided.
|
|
581
581
|
*
|
|
582
|
-
* @param {
|
|
582
|
+
* @param {object} [config] The part of the config to copy and serialize. Omit this argument to return the entire config.
|
|
583
583
|
* @returns {object} The cloned config or part of the config
|
|
584
584
|
*/
|
|
585
|
-
toObject(config) {
|
|
586
|
-
return Util.toObject(config
|
|
585
|
+
toObject(config = this.#config) {
|
|
586
|
+
return Util.toObject(config);
|
|
587
587
|
}
|
|
588
588
|
|
|
589
589
|
/**
|
|
590
590
|
* Run strictness checks on NODE_ENV and NODE_APP_INSTANCE and throw an error if there's a problem.
|
|
591
|
-
* @param {Config} config
|
|
591
|
+
* @param {Config} [config]
|
|
592
592
|
*/
|
|
593
593
|
runStrictnessChecks(config = this.#config) {
|
|
594
594
|
const load = config[LOAD_SYMBOL];
|
package/lib/util.js
CHANGED
|
@@ -713,7 +713,7 @@ class Util {
|
|
|
713
713
|
* @method extendDeep
|
|
714
714
|
* @param mergeInto {Object} The object to merge into
|
|
715
715
|
* @param mergeFrom... {Object} - Any number of objects to merge from
|
|
716
|
-
* @param [depth]
|
|
716
|
+
* @param {number} [depth=20] - An optional depth to prevent recursion. Default: 20.
|
|
717
717
|
* @return {Object} The altered mergeInto object is returned
|
|
718
718
|
*/
|
|
719
719
|
static extendDeep(mergeInto, ...vargs) {
|
|
@@ -1357,7 +1357,6 @@ class Load {
|
|
|
1357
1357
|
* This function exists in part to reduce the circular dependency of variable initializations
|
|
1358
1358
|
* in the config.js file
|
|
1359
1359
|
* @param {string} environments the NODE_CONFIG_ENVs you want to load
|
|
1360
|
-
* @private
|
|
1361
1360
|
* @returns {Load}
|
|
1362
1361
|
*/
|
|
1363
1362
|
static fromEnvironment(environments) {
|
package/package.json
CHANGED
package/types/lib/config.d.ts
CHANGED
|
@@ -329,7 +329,7 @@ declare class ConfigUtils {
|
|
|
329
329
|
*
|
|
330
330
|
* @method attachProtoDeep
|
|
331
331
|
* @param {object} toObject
|
|
332
|
-
* @param {number
|
|
332
|
+
* @param {number} [depth=20]
|
|
333
333
|
* @return {object}
|
|
334
334
|
*/
|
|
335
335
|
attachProtoDeep(toObject: object, depth?: number): object;
|
|
@@ -349,13 +349,13 @@ declare class ConfigUtils {
|
|
|
349
349
|
/**
|
|
350
350
|
* Returns a new deep copy of the current config object, or any part of the config if provided.
|
|
351
351
|
*
|
|
352
|
-
* @param {
|
|
352
|
+
* @param {object} [config] The part of the config to copy and serialize. Omit this argument to return the entire config.
|
|
353
353
|
* @returns {object} The cloned config or part of the config
|
|
354
354
|
*/
|
|
355
|
-
toObject(config
|
|
355
|
+
toObject(config?: object): object;
|
|
356
356
|
/**
|
|
357
357
|
* Run strictness checks on NODE_ENV and NODE_APP_INSTANCE and throw an error if there's a problem.
|
|
358
|
-
* @param {Config} config
|
|
358
|
+
* @param {Config} [config]
|
|
359
359
|
*/
|
|
360
360
|
runStrictnessChecks(config?: Config): void;
|
|
361
361
|
/**
|
package/types/lib/util.d.ts
CHANGED
|
@@ -285,7 +285,7 @@ export class Util {
|
|
|
285
285
|
* @method extendDeep
|
|
286
286
|
* @param mergeInto {Object} The object to merge into
|
|
287
287
|
* @param mergeFrom... {Object} - Any number of objects to merge from
|
|
288
|
-
* @param [depth]
|
|
288
|
+
* @param {number} [depth=20] - An optional depth to prevent recursion. Default: 20.
|
|
289
289
|
* @return {Object} The altered mergeInto object is returned
|
|
290
290
|
*/
|
|
291
291
|
static extendDeep(mergeInto: any, ...vargs: any[]): any;
|
|
@@ -368,10 +368,9 @@ export class Load {
|
|
|
368
368
|
* This function exists in part to reduce the circular dependency of variable initializations
|
|
369
369
|
* in the config.js file
|
|
370
370
|
* @param {string} environments the NODE_CONFIG_ENVs you want to load
|
|
371
|
-
* @private
|
|
372
371
|
* @returns {Load}
|
|
373
372
|
*/
|
|
374
|
-
|
|
373
|
+
static fromEnvironment(environments: string): Load;
|
|
375
374
|
/**
|
|
376
375
|
* @constructor
|
|
377
376
|
* @param {LoadOptions=} options - defaults to reading from environment variables
|