nd

node-deepcopy

deep copy for any JavaScript object

Showing:

Popularity

Downloads/wk

0

GitHub Stars

2

Maintenance

Last Commit

6yrs ago

Contributors

0

Package

Dependencies

0

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

node-deepcopy

Build Status Coverage Status npm version Dependency Status

https://www.npmjs.org/package/node-deepcopy

deep copy for any JavaScript object.

Installation

Example

var deepcopy = require('node-deepcopy').deepcopy;
var toValue = function(obj){
    return isFunction(obj) || isRegExp(obj) ? obj.toString() : JSON.stringify(obj);
};
var foo = function () {
        this.c = 3;
        this.a = [
            {e: 2, f: 'good', g: [1, 2, 3]}
        ];
        this.b = 'b';
        this.d = function () {
            console.log("I'm foo.d.")
        };
    };
var source = new foo();
var cloned = deepcopy(source);
cloned2.a[0].f = '666';
console.log(cloned === source));

License

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial