isnovid.merge

0.2.0

npm install isnovid.merge
2 downloads in the last week
8 downloads in the last month

isnovid.merge

0.2.0

Interface

Install

npm install isnovid.merge

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

Require

Server merge = require "isnovid.merge"

Client merge = isnovid.merge

merge arguments..., depth

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 source, target, Infinity
        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

Further, examples of the use of depth limitation.

merge source, target, 1

    a: 2
    c: 
        a: [2,3,4]
        c: 
            a: 2

merge source, target, 2

    a: 2
    b: 1
    c: 
        a: [2,3,4]
        c: 
            a: 2

merge source, target, 3

    a: 2
    b: 1
    c: 
        a: [2,3,4]
        b: 1
        c: 
            a: 2

merge source, target, 4

    a: 2
    b: 1
    c: 
        a: [2,3,4]
        b: 1
        c: 
            a: 2
            b: 1
npm loves you