isnovid.merge

0.2.0

merge

0.1.1

If you want to use the library in pure javascript, compiled and compressed version are available at library/merge.js

npm install isnovid.merge

git clone git://github.com/isnovid/merge.git

Server merge = require "isnovid.merge"

Client merge = isnovid.merge

In turn puts all arguments to the first argument. Required to specify the depth argument.

source:
    a: 1
    b: 1
    c: 
        a: [1,2,3]
        b: 1
        c: 
            a: 1
            b: 1
target:
    a: 2
    c: 
        a: [2,3,4]
        c: 
            a: 2
result = merge sourcetargetInfinity
###
source =
        a: 2
        b: 1
        c: 
            a: [2,3,4]
            b: 1
            c: 
                a: 2
                b: 1
###

merge source, target, Infinity equivalently merge.deep source, target and merge.large soruce, target

merge source, target, 1 equivalently merge.shallow source, target

merge source, target, 1

source:
    a: 1
    b: 1
    c: 
        a: [1,2,3]
        b: 1
        c: 
            a: 1
            b: 1
target:
    a: 2
    c: 
        a: [2,3,4]
        c: 
            a: 2
result = merge sourcetargetInfinity
###
source =
    a: 2
    c: 
        a: [2,3,4]
        c: 
            a: 2
###
 
`merge source, target, 2`
```coffeescript
source:
    a: 1
    b: 1
    c: 
        a: [1,2,3]
        b: 1
        c: 
            a: 1
            b: 1
target:
    a: 2
    c: 
        a: [2,3,4]
        c: 
            a: 2
result = merge source, target, Infinity
###
source =
    a: 2
    b: 1
    c: 
        a: [2,3,4]
        c: 
            a: 2
###

merge source, target, 3

source:
    a: 1
    b: 1
    c: 
        a: [1,2,3]
        b: 1
        c: 
            a: 1
            b: 1
target:
    a: 2
    c: 
        a: [2,3,4]
        c: 
            a: 2
result = merge sourcetargetInfinity
###
source =
    a: 2
    b: 1
    c: 
        a: [2,3,4]
        b: 1
        c: 
            a: 2
###

merge source, target, 4

source:
    a: 1
    b: 1
    c: 
        a: [1,2,3]
        b: 1
        c: 
            a: 1
            b: 1
target:
    a: 2
    c: 
        a: [2,3,4]
        c: 
            a: 2
result = merge sourcetargetInfinity
###
source =
    a: 2
    b: 1
    c: 
        a: [2,3,4]
        b: 1
        c: 
            a: 2
            b: 1
###

0.1.1

Issues 1

0.1.0

Initial release.