gergoruha89 / universal-copy

Deep copy anything.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Universal Copy

Deep copy anything. Works on Objects, Arrays, Sets, Maps, RegExp, Dates, TypedArrays, ArrayBuffers, NodeLists, and more. Handles circular references correctly.

var universalCopy = require('universal-copy')

API

universalCopy(anything)

Returns a recursive deep copy of anything. Returns the originals for things that are passed by value instead of reference, and functions, where the meaning of copying is ambiguous. For everything else it creates a new object with the same values as the old one, to the best of its ability. Copy includes symbols and non-enumerable properties, uses define property to keep the same status as the property being copied.

About

Deep copy anything.

License:ISC License


Languages

Language:JavaScript 100.0%