diff options
author | 2023-05-26 10:02:35 -0300 | |
---|---|---|
committer | 2023-05-26 15:02:35 +0200 | |
commit | bf63f615fc1b97d6fb84db55f7639084e3ada5af (patch) | |
tree | 5e4f488ba3ed6e03d4d0c1c216c52b0c20fc51fd /packages/webapi/src/ponyfill.ts | |
parent | 52af9ad18840ffa4e2996386c82cbe34d9fd076a (diff) | |
download | astro-bf63f615fc1b97d6fb84db55f7639084e3ada5af.tar.gz astro-bf63f615fc1b97d6fb84db55f7639084e3ada5af.tar.zst astro-bf63f615fc1b97d6fb84db55f7639084e3ada5af.zip |
Add global crypto to @astrojs/webapi (#6981)
* add crypto to be polyfilled
* chore: changeset
* chore: update deps for node types
---------
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
Co-authored-by: Princesseuh <princssdev@gmail.com>
Diffstat (limited to 'packages/webapi/src/ponyfill.ts')
-rw-r--r-- | packages/webapi/src/ponyfill.ts | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/packages/webapi/src/ponyfill.ts b/packages/webapi/src/ponyfill.ts index 368f7ee5b..9be4377c5 100644 --- a/packages/webapi/src/ponyfill.ts +++ b/packages/webapi/src/ponyfill.ts @@ -14,6 +14,7 @@ import { WritableStreamDefaultController, WritableStreamDefaultWriter, } from 'node:stream/web' // Remove when Node 16 is dropped for Node 18. +import { webcrypto as crypto } from 'node:crypto' // Remove when Node 18 is dropped for Node 20 import { fetch, File, FormData, Headers, Request, Response } from 'undici' // Remove when Node 16 is dropped for Node 18. import { URLPattern } from 'urlpattern-polyfill' import { @@ -133,6 +134,7 @@ export { cancelAnimationFrame, cancelIdleCallback, clearTimeout, + crypto, fetch, requestAnimationFrame, requestIdleCallback, |