Nifty Purring Manticore
Learn how companies like Phone2Action are using npm in their front-end developmentJoin the conversation »

deep-cloning

1.1.0 • Public • Published

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}]

Install

npm i deep-cloning

DownloadsWeekly Downloads

1

Version

1.1.0

License

MIT

Last publish

Collaborators

  • avatar