2.4.0 • Published 3 years ago

@johanholmerin/structured-clone v2.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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