Skip to content

Library to create a deep copy of JavaScript data structures

License

Notifications You must be signed in to change notification settings

GreyArk/deep-cloning

Repository files navigation

Deep-Cloning

Build Status Coverage Status bitHound Overall Score

NPM

A single method library for (deep) cloning any kind of data structure - like Object, Array, RegExp, Date as well as primitives.

Usage

Use the npm package deep-cloning to your project:

npm install --save deep-cloning
// Import
const deepClone = require('deepClone');

let arr = [{ a: 0, b: 2}, { a: 3, b: 5}];

let clonedArr = deepClone(arr);

arr[0][a] = 6;
// => [{a: 6, b: 2}, { a: 3, b: 5}];

console.log(clonedArr);
// => [{a: 0, b: 2}, { a: 3, b: 5}]

About

Library to create a deep copy of JavaScript data structures

Resources

License

Stars

Watchers

Forks

Packages

No packages published