config 2.0.1 → 2.0.2
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/History.md +6 -0
- package/README.md +1 -1
- package/lib/config.js +7 -6
- package/package.json +1 -1
package/History.md
CHANGED
package/README.md
CHANGED
|
@@ -171,6 +171,6 @@ License
|
|
|
171
171
|
|
|
172
172
|
May be freely distributed under the [MIT license](https://raw.githubusercontent.com/lorenwest/node-config/master/LICENSE).
|
|
173
173
|
|
|
174
|
-
Copyright (c) 2010-
|
|
174
|
+
Copyright (c) 2010-2018 Loren West
|
|
175
175
|
[and other contributors](https://github.com/lorenwest/node-config/graphs/contributors)
|
|
176
176
|
|
package/lib/config.js
CHANGED
|
@@ -276,17 +276,18 @@ util.setModuleDefaults = function (moduleName, defaultProperties) {
|
|
|
276
276
|
parsed: {}
|
|
277
277
|
});
|
|
278
278
|
}
|
|
279
|
-
configSources[0].parsed
|
|
280
|
-
util.extendDeep(configSources[0].parsed
|
|
279
|
+
util.setPath(configSources[0].parsed, moduleName.split('.'), {});
|
|
280
|
+
util.extendDeep(getImpl(configSources[0].parsed, moduleName), defaultProperties);
|
|
281
281
|
|
|
282
282
|
// Create a top level config for this module if it doesn't exist
|
|
283
|
-
t
|
|
283
|
+
util.setPath(t, moduleName.split('.'), getImpl(t, moduleName) || {});
|
|
284
284
|
|
|
285
285
|
// Extend local configurations into the module config
|
|
286
|
-
util.
|
|
286
|
+
util.setPath(moduleConfig, moduleName.split('.'), getImpl(moduleConfig, moduleName) || {});
|
|
287
|
+
util.extendDeep(moduleConfig, getImpl(t, moduleName));
|
|
287
288
|
|
|
288
289
|
// Merge the extended configs without replacing the original
|
|
289
|
-
util.extendDeep(t
|
|
290
|
+
util.extendDeep(getImpl(t, moduleName), moduleConfig);
|
|
290
291
|
|
|
291
292
|
// reset the mutability check for "config.get" method.
|
|
292
293
|
// we are not making t[moduleName] immutable immediately,
|
|
@@ -296,7 +297,7 @@ util.setModuleDefaults = function (moduleName, defaultProperties) {
|
|
|
296
297
|
}
|
|
297
298
|
|
|
298
299
|
// Attach handlers & watchers onto the module config object
|
|
299
|
-
return util.attachProtoDeep(t
|
|
300
|
+
return util.attachProtoDeep(getImpl(t, moduleName));
|
|
300
301
|
};
|
|
301
302
|
|
|
302
303
|
/**
|