Working well

This commit is contained in:
Bryan Ashby 2020-06-10 22:52:19 -06:00
parent 56472c80a8
commit 37bc2fc3aa
No known key found for this signature in database
GPG Key ID: B49EB437951D2542
1 changed files with 7 additions and 4 deletions

View File

@ -149,23 +149,26 @@ module.exports = class ConfigLoader {
}
const prev = stack[stack.length - 1];
if (source === prev.source) {
path = prev.path.concat(key);
stack.push({source : configVal, path});
break;
}
stack.pop();
}
path = path.join('.');
return options.defaultsCustomizer(defaultVal, configVal, key, path);
}
);
return callback(null, mergedConfig);
} else {
// :TODO: correct?
_.defaultsDeep(config, options.defaultConfig);
return callback(null, config);
}
// :TODO: correct?
return callback(null, _.merge(options.defaultConfig, config));
},
(config, callback) => {
const configRoot = paths.dirname(basePath);