Socket
Socket
Sign inDemoInstall

universal-copy

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    universal-copy

Deep copy anything.


Version published
Maintainers
1
Install size
12.8 kB
Created

Readme

Source

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.

Keywords

FAQs

Last updated on 02 Mar 2016

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc