defaults-deep-preserve-arrays
This repo is deprecated. Please use @nodeutils/defaults-deep
Similar to lodash's defaultsDeep, but without mutating the source object, and no merging of arrays
Installation
Install the package via npm
:
$ npm install defaults-deep-preserve-arrays
Usage
Arguments
[sources]
(...Object): The source objects. Provide 2 or more, in descending order of importance
Returns
(Object): Returns the merged objects
Example
var defaultsDeep = ; var objectA = bar: biz: net: 'txi' qox: 'fuc' qux: 'baz' ;var objectB = bar: biz: net: 'qux' qux: 'biz' 'ban' ;var objectC = bar: biz: net: 'qux' lee: 'sox' qux: 'biz' 'rep' foo: 'bar' ; ;// => { bar: { biz: { net: 'qux', qox: 'fuc', lee: 'sox' } }, qux: ['baz'], foo: 'bar' }
How
Incredibly simple:
"use strict";const _ = ;module { let output = {}; _; return output;};