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

View file

@ -149,23 +149,26 @@ module.exports = class ConfigLoader {
} }
const prev = stack[stack.length - 1]; const prev = stack[stack.length - 1];
if (source === prev.source) { if (source === prev.source) {
path = prev.path.concat(key); path = prev.path.concat(key);
stack.push({source : configVal, path}); stack.push({source : configVal, path});
break; break;
} }
stack.pop(); stack.pop();
} }
path = path.join('.'); path = path.join('.');
return options.defaultsCustomizer(defaultVal, configVal, key, path); return options.defaultsCustomizer(defaultVal, configVal, key, path);
} }
); );
return callback(null, mergedConfig); 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) => { (config, callback) => {
const configRoot = paths.dirname(basePath); const configRoot = paths.dirname(basePath);