rapid-clone
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Rapid JavaScript Object Deep Clone

Note

Only data extracted through JSON.stringify() is duplicated.

Usage

const { cloneObjectDeep, cloneArrayDeep } = require('rapid-clone');

const obj1 = {
    color: 'Yellow',
    age: 30,
    nothing: null,
    currentDate: new Date(),
    low: {
        middle: {},
        someList: [
            1,
            2,
            3,
            {
                name: 'Kim',
                health: 30,
            },
        ],
    },
};

const obj2 = cloneObjectDeep(obj1);

const arr1 = [1, 2, 3, 'yellow', true];
const arr2 = cloneArrayDeep(arr1);

Readme

Keywords

Package Sidebar

Install

npm i rapid-clone

Weekly Downloads

0

Version

1.0.3

License

ISC

Unpacked Size

4.25 kB

Total Files

6

Last publish

Collaborators

  • honsemiro