chbrown / rfc6902

Complete implementation of RFC6902 in TypeScript
https://chbrown.github.io/rfc6902/
316 stars 39 forks source link

`util.clone` can be replaced with `structuredClone` #90

Open steida opened 2 years ago

steida commented 2 years ago

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

chbrown commented 2 years ago

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 commented 2 years ago

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