Skip to content

Standalone functions for creating shallow clones or deep clones.

License

Notifications You must be signed in to change notification settings

fabiospampinato/duper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Duper

Standalone functions for creating shallow clones or deep clones.

It supports cloning primitives, Array, Map, Set, Date, RegExp, ArrayBuffer, DataView, Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array, BigInt64Array, BigUint64Array, Error, EvalError, RangeError, ReferenceError, SyntaxError, TypeError, URIError, and plain objects, trying to clone anything else will throw.

Install

npm install --save duper

Usage

import {cloneShallow, cloneDeep} from 'duper';

cloneShallow ({ foo: { value: 123 } }); // => Shallow clone of the object
cloneDeep ({ foo: { value: 123 } }); // => Deep clone of the object

License

MIT © Fabio Spampinato

About

Standalone functions for creating shallow clones or deep clones.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published