@clarketm/deepclone

1.1.4 • Public • Published

DeepClone

Light-weight deep clone implementation for JavaScript.

NPM release Build Status

ℹ️ For a standalone Object type with this deep clone implementation, check out the super repository: super/object

Installation

$ npm install @clarketm/deepclone

Modules

DeepClone

Functions

DeepClone(obj, [config])object

Typedefs

Config : object

DeepClone

DeepClone(obj, [config]) ⇒ object

Kind: global method of DeepClone
Returns: object - cloned object

Param Type Default
obj object
[config] Config {}

Example

const clone = DeepClone({ key1: ["1", 1, true, (a, b) => a+b], [Symbol("key2")]: {s: "s"} });

console.log(clone);
// { key1: ["1", 1, true, (a, b) => a+b], Symbol("key2"): {s: "s"} }

Config : object

Kind: global typedef
Properties

Name Type Default
[includeNonEnumerable] boolean false

Package Sidebar

Install

npm i @clarketm/deepclone

Weekly Downloads

12

Version

1.1.4

License

MIT

Unpacked Size

1.52 MB

Total Files

49

Last publish

Collaborators

  • clarketm