deep-clone-simple

1.1.1 • Public • Published

Deep clone simple

Deep clone utlity function for JavaScript that is limited to basic data types:

  • Objects { hello: 2 }
  • Array [1, 2, 3]
  • Number 5.2
  • Boolean true
  • String "hello"
  • Date new Date()
  • Functions function bla() {}
  • null

Minimizes to 279 bytes.

Only works with modern bundlers that support the module entry point like Rollup, Webpack 2+.

Installation

yarn add deep-clone-simple

Usage

import deepClone from 'deep-clone-simple';
 
const copy = deepClone(someData);

Run tests

yarn test
yarn test-watch

Readme

Keywords

none

Package Sidebar

Install

npm i deep-clone-simple

Weekly Downloads

45,698

Version

1.1.1

License

Apache-2.0

Last publish

Collaborators

  • balloob