MCPcopy Create free account
hub / github.com/node-config/node-config / withModuleDefaults

Method withModuleDefaults

lib/config.mjs:250–257  ·  view source on GitHub ↗

* Set default configurations for a node.js module. * * This variant is provided to support handling loading of multiple versions * of a library. This is meant for module developers to create a config snapshot * for an old version of the code, particularly during a staged upgrade. * In

(moduleName, defaultProperties)

Source from the content-addressed store, hash-verified

248 * @see Load.scan() for loading more robust defaults
249 */
250 withModuleDefaults(moduleName, defaultProperties) {
251 const load = this.#config[LOAD_SYMBOL];
252 const copy = new ConfigClass(load.clone());
253
254 copy.util.setModuleDefaults(moduleName, defaultProperties);
255
256 return copy;
257 }
258
259 /**
260 * <p>Make a javascript object property immutable (assuring it cannot be changed

Callers 1

2-config-test.jsFile · 0.80

Calls 2

cloneMethod · 0.45
setModuleDefaultsMethod · 0.45

Tested by

no test coverage detected