Skip to content

Latest commit

 

History

History

deep-clone

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Deep Clone

Clone deeply nested objects and arrays in JavaScript.

Installation

yarn add @alwatr/deep-clone

Usage

import {deepClone} from '@alwatr/deep-clone';

const obj1 = {
  a: 1,
  b: {
    c: 2,
    d: [3, 4, 5],
  },
};

const obj2 = deepClone(obj1);

obj2.b.c = 6;
console.log(obj1.b.c); // 2

Sponsors

The following companies, organizations, and individuals support Nanolib ongoing maintenance and development. Become a Sponsor to get your logo on our README and website.

Exir Studio

Contributing

Contributions are welcome! Please read our contribution guidelines before submitting a pull request.

License

This project is licensed under the AGPL-3.0 License.