@johanholmerin/structured-clone

2.4.0 • Public • Published

Structured clone

A Javascript implementation of the structured clone algorithm.

No external dependencies.

Install

# Yarn
yarn add @johanholmerin/structured-clone

# npm
npm install @johanholmerin/structured-clone

Usage

import structuredClone from '@johanholmerin/structured-clone';

const newObj = structuredClone(obj);

Limitations

  • CryptoKey and ImageBitmap are not supported, since there is no way to synchronously make a copy.
  • Copying FileList is only supported in browsers that support the DataTransfer constructor.
  • Does not support the transfer parameter

Readme

Keywords

none

Package Sidebar

Install

npm i @johanholmerin/structured-clone

Weekly Downloads

0

Version

2.4.0

License

MIT

Unpacked Size

7.52 kB

Total Files

4

Last publish

Collaborators

  • johanholmerin