@clarketm/deepclone
v1.1.4
Published
JavaScript deep clone implementation
Downloads
13
Readme
DeepClone
Light-weight deep clone implementation for JavaScript.
ℹ️ For a standalone Object type with this deep clone implementation, check out the super repository: super/object
Installation
$ npm install @clarketm/deepclone
Modules
Functions
Typedefs
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 |