UNPKG

@nodeutils/defaults-deep

Version:

Like lodash's _.defaultsDeep, but with array preservation

12 lines (11 loc) 337 B
"use strict"; var _ = require("lodash"); module.exports = function () { var output = {}; _.toArray(arguments).reverse().forEach(function (item) { _.mergeWith(output, item, function (objectValue, sourceValue) { return _.isArray(sourceValue) ? sourceValue : undefined; }); }); return output; };