Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

util.clone can be replaced with structuredClone #90

Open
steida opened this issue Jun 2, 2022 · 2 comments
Open

util.clone can be replaced with structuredClone #90

steida opened this issue Jun 2, 2022 · 2 comments

Comments

@steida
Copy link

steida commented Jun 2, 2022

https://developer.mozilla.org/en-US/docs/Web/API/structuredClone

@chbrown chbrown changed the title A custom clone function can be replaced with structuredClone util.clone can be replaced with structuredClone Jun 7, 2022
@chbrown
Copy link
Owner

chbrown commented Jun 7, 2022

Interesting. Did not know about that function.

MDN says it was introduced in Node.js 17.0.0, and Node.js v16 doesn't EOL until 2024-04-30, so I won't be incorporating this anytime soon, but good to keep in mind!

@steida
Copy link
Author

steida commented Jun 7, 2022

@chbrown You can use a polyfill https://github.com/ungap/structured-clone or even something like structuredClone || yourCode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants