UNPKG

read-config-ng

Version:
20 lines 601 B
import * as _ from 'lodash'; /** * Merge multiple configuration objects * Arrays are replaced, not merged */ export function mergeConfigs(configs) { if (!configs || !configs.length) { return {}; } // Custom merge function: arrays are replaced, not merged const customizer = (objValue, srcValue) => { if (Array.isArray(objValue)) { return srcValue; } return undefined; // Use default merging for other types }; return _.mergeWith({}, ...configs, customizer); } export default mergeConfigs; //# sourceMappingURL=merge-configs.js.map