Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johanholmerin/structured-clone
Structured clone algorithm in Javascript
https://github.com/johanholmerin/structured-clone
Last synced: about 1 month ago
JSON representation
Structured clone algorithm in Javascript
- Host: GitHub
- URL: https://github.com/johanholmerin/structured-clone
- Owner: johanholmerin
- License: mit
- Created: 2018-05-15T11:27:21.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-07-28T14:04:40.000Z (over 3 years ago)
- Last Synced: 2024-11-19T16:14:53.411Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 115 KB
- Stars: 3
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Structured clone
A Javascript implementation of the structured clone algorithm.
No external dependencies.
## Install
```sh
# Yarn
yarn add @johanholmerin/structured-clone# npm
npm install @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.
- Does not support the [transfer](https://html.spec.whatwg.org/multipage/structured-data.html#structured-cloning) parameter