A Javascript implementation of the structured clone algorithm.
npm install @johanholmerin/structured-cloneA Javascript implementation of the structured clone algorithm.
No external dependencies.
``shYarn
yarn add @johanholmerin/structured-clone
Usage
`javascript
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.