isnovid.clone

0.2.0

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

isnovid.clone

0.2.0

Interface

Install

npm install isnovid.clone

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

Require

Server clone = require "isnovid.clone"

Client clone = isnovid.clone

clone data, depth = Infinify

The argument of "data" - link to the cloned data.

source =
    name: "snovid.clone"
    version: "0.0.0",
    about:
        data: "objects"
        others: 
            depth: false

target = clone source
target.version = "0.1.0"
target.about.data = "anything"
target.about.others.depth = true

###
source =
    name: "snovid.clone"
    version: "0.0.0",
    about:
        data: "objects and arrays"
        others: 
            depth: false
target =
    name: "snovid.clone"
    version: "0.1.0",
    about:
        data: "any"
        others: 
            depth: true
###

Default cloning is not limited in depth. However, to use limit can be specified depth.

Further, examples of the use of depth limitation.

target = clone source, 0

###
source =
    name: "snovid.clone"
    version: "0.1.0",
    about:
        data: "any"
        others: 
            depth: true
target =
    name: "snovid.clone"
    version: "0.1.0",
    about:
        data: "any"
        others: 
            depth: true
###

If the recess is equal to zero, it is logical that not one of the levels of cloning will occur.

target = clone source, 1

###
source =
    name: "snovid.clone"
    version: "0.0.0",
    about:
        data: "any"
        others: 
            depth: true
target =
    name: "snovid.clone"
    version: "0.1.0",
    about:
        data: "any"
        others: 
            depth: true
###

Notice. Cloning was only a depression in Level 1.

target = clone source, 2

###
source =
    name: "snovid.clone"
    version: "0.0.0",
    about:
        data: "objects and arrays"
        others: 
            depth: true
target =
    name: "snovid.clone"
    version: "0.1.0",
    about:
        data: "any"
        others: 
            depth: true
###

Notice. Cloning took place only in a recess in the first two levels.

The number of levels is not limited.

npm loves you