--
This commit is contained in:
parent
24f3d27984
commit
6b60015c02
9588 changed files with 1149251 additions and 49 deletions
70
node_modules/deepmerge/README.markdown
generated
vendored
Normal file
70
node_modules/deepmerge/README.markdown
generated
vendored
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
deepmerge
|
||||
=========
|
||||
|
||||
Merge the enumerable attributes of two objects deeply.
|
||||
|
||||
example
|
||||
=======
|
||||
|
||||
```js
|
||||
var util = require('util')
|
||||
var merge = require('deepmerge')
|
||||
|
||||
var x = { foo: { bar: 3 },
|
||||
array: [ { does: 'work', too: [ 1, 2, 3 ] } ] }
|
||||
var y = { foo: { baz: 4 },
|
||||
quux: 5,
|
||||
array: [ { does: 'work', too: [ 4, 5, 6 ] }, { really: 'yes' } ] }
|
||||
|
||||
console.log(util.inspect(merge(x, y), false, null))
|
||||
```
|
||||
|
||||
output:
|
||||
|
||||
```js
|
||||
{ foo: { bar: 3, baz: 4 },
|
||||
array: [ { does: 'work', too: [ 1, 2, 3, 4, 5, 6 ] }, { really: 'yes' } ],
|
||||
quux: 5 }
|
||||
```
|
||||
|
||||
methods
|
||||
=======
|
||||
|
||||
var merge = require('deepmerge')
|
||||
|
||||
merge(x, y)
|
||||
-----------
|
||||
|
||||
Merge two objects `x` and `y` deeply, returning a new merged object with the
|
||||
elements from both `x` and `y`.
|
||||
|
||||
If an element at the same key is present for both `x` and `y`, the value from
|
||||
`y` will appear in the result.
|
||||
|
||||
The merge is immutable, so neither `x` nor `y` will be modified.
|
||||
|
||||
The merge will also merge arrays and array values.
|
||||
|
||||
install
|
||||
=======
|
||||
|
||||
With [npm](http://npmjs.org) do:
|
||||
|
||||
```
|
||||
npm install deepmerge
|
||||
```
|
||||
|
||||
For the browser, you can install with [bower](http://bower.io/):
|
||||
|
||||
```
|
||||
bower install deepmerge
|
||||
```
|
||||
|
||||
test
|
||||
====
|
||||
|
||||
With [npm](http://npmjs.org) do:
|
||||
|
||||
```
|
||||
npm test
|
||||
```
|
||||
Loading…
Reference in a new issue