Socket
Book a DemoInstallSign in
Socket

@mikeal/realistic-structured-clone

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mikeal/realistic-structured-clone

A pure JS implementation of the structured clone algorithm (or at least something pretty close to that)

latest
Source
npmnpm
Version
3.0.5
Version published
Maintainers
1
Created
Source

Realistic Structured Clone

39837 9311

This is a fork of https://github.com/dumbmatter/realistic-structured-clone with Node.js support removed in order to bring down the bundle size in the browser. Recent versions of Node.js have a much better/faster way to do deep clones using v8 serialize/deserialize.

This is a pure JS implementation of the structured clone algorithm (or at least something pretty close to that).

Use

Install through npm:

$ npm install @mikeal/realistic-structured-clone

Then use it:

// First load the module
// (Use Browserify or something if you're targeting the web)
var structuredClone = require('@mikeal/realistic-structured-clone');

// Clone a variable (will throw a DataCloneError for invalid input)
var clonedX = structuredClone(x);

License

Apache 2.0

Keywords

structured

FAQs

Package last updated on 10 Oct 2020

Did you know?

Socket

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