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

0.1.7 • Public • Published

@stackmeister/clone

Deep cloning utility.

Supports reference integrity. Can clone circular structures.

It won't keep object identity, only for arrays.

Install

// Yarn
yarn add @stackmeister/clone

// NPM
npm i @stackmeister/clone

TypeScript typings are included (No @types/ package needed)

Usage

import clone from '@stackmeister/clone'
import equals from '@stackmeister/equals'

const a = { a: [1, 2, 3] }
const b = clone(a)

a === b      // false
equals(a, b) // true

Readme

Keywords

none

Package Sidebar

Install

npm i @stackmeister/clone

Weekly Downloads

1

Version

0.1.7

License

MIT

Unpacked Size

8.25 kB

Total Files

7

Last publish

Collaborators

  • torbenkoehn