MCPcopy Index your code
hub / github.com/node-config/node-config / loadCustomEnvVars

Method loadCustomEnvVars

lib/util.js:1187–1201  ·  view source on GitHub ↗

* load custom-environment-variables * * @param extNames {string[]=} extensions * @returns {{}}

(extNames)

Source from the content-addressed store, hash-verified

1185 * @returns {{}}
1186 */
1187 loadCustomEnvVars(extNames) {
1188 let resolutionIndex = 1;
1189 const allowedFiles = {};
1190
1191 extNames = extNames ?? this.parser.getFilesOrder();
1192
1193 extNames.forEach(function (extName) {
1194 allowedFiles['custom-environment-variables' + '.' + extName] = resolutionIndex++;
1195 });
1196
1197 const locatedFiles = Util.locateMatchingFiles(this.options.configDir, allowedFiles);
1198 locatedFiles.forEach((fullFilename) => {
1199 this.loadFile(fullFilename, (configObj) => this.substituteDeep(configObj, process.env));
1200 });
1201 }
1202
1203 /**
1204 * Return the report of where the sources for this load operation came from

Callers 2

scanMethod · 0.95
0-util.jsFile · 0.80

Calls 3

loadFileMethod · 0.95
substituteDeepMethod · 0.95
locateMatchingFilesMethod · 0.80

Tested by

no test coverage detected