🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

deep-clone-simple

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deep-clone-simple

Tiny deep clone utility for simple data structures.

1.1.1
latest
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created

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

FAQs

Package last updated on 30 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts