2.4.0 • Published 4 years ago
@johanholmerin/structured-clone v2.4.0
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-cloneUsage
import structuredClone from '@johanholmerin/structured-clone';
const newObj = structuredClone(obj);Limitations
CryptoKeyandImageBitmapare not supported, since there is no way to synchronously make a copy.- Copying
FileListis only supported in browsers that support theDataTransferconstructor. - Does not support the transfer parameter