unjs / unenv

🕊️ Convert javaScript code to be runtime agnostic
MIT License
358 stars 19 forks source link

fix(node:crypto): properly call web crypto methods #122

Closed AaronDewes closed 1 year ago

AaronDewes commented 1 year ago

The latest change broke some Nuxt deployments to Deno deploy for me. Deno's webcrypto is somewhat different, and ...globalThis.crypto does not work in Deno. This replaces it with a custom getter that retrieves the correct value instead. This adds some overhead, but is required for Deno compatibility.

grafik