@alwatr/deep-clone
TypeScript icon, indicating that this package has built-in type declarations

5.0.0 • Public • Published

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.

Package Sidebar

Install

npm i @alwatr/deep-clone

Weekly Downloads

150

Version

5.0.0

License

AGPL-3.0-only

Unpacked Size

54.9 kB

Total Files

12

Last publish

Collaborators

  • alimd