diff --git a/lib/configLoader.js b/lib/configLoader.js index 0e093d3..2620c30 100644 --- a/lib/configLoader.js +++ b/lib/configLoader.js @@ -25,7 +25,7 @@ module.exports = { function mergeConfig(...configs) { logger.trace('merge all config') - return butil.assignWithValid({}, ...configs) + return butil.mergeWithValid({}, ...configs) } /** diff --git a/lib/util.js b/lib/util.js index 35e3e78..4a30f64 100644 --- a/lib/util.js +++ b/lib/util.js @@ -63,14 +63,14 @@ function assignPredict(older, newer) { function mergeWithValid(...sources) { sources.push(mergeCustomizer) - return _.assignWith(...sources) + return _.mergeWith(...sources) } function mergeCustomizer(older, newer) { if (Array.isArray(older)) { return older.concat(newer) } else if (_.isObject(older) && _.isObject(newer)) { - return assignWithValid(older, newer) + return mergeWithValid(older, newer) } return isEmpty(newer) ? older : newer