File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88 * without any mocking.
99 */
1010
11- import { webcrypto } from 'crypto' ;
11+ import { webcrypto } from 'node: crypto' ;
1212
1313// Polyfill for Node versions < 19 that do not expose globalThis.crypto
1414if ( ! globalThis . crypto ) {
@@ -18,7 +18,7 @@ if (!globalThis.crypto) {
1818// cryptoRSA.ts accesses `window.crypto`, `window.btoa`, and `window.atob`.
1919// In a Node (non-jsdom) environment `window` is undefined, so we point it at
2020// globalThis which already has btoa/atob (Node 16+) and crypto (Node 19+).
21- if ( typeof window === 'undefined' ) {
21+ if ( typeof globalThis . window === 'undefined' ) {
2222 ( globalThis as any ) . window = globalThis ;
2323}
2424
Original file line number Diff line number Diff line change 55 * in both Node.js and browser environments.
66 */
77
8- import { webcrypto } from 'crypto' ;
8+ import { webcrypto } from 'node: crypto' ;
99
1010if ( ! globalThis . crypto ) {
1111 ( globalThis as any ) . crypto = webcrypto ;
1212}
1313
14- if ( typeof window === 'undefined' ) {
14+ if ( typeof globalThis . window === 'undefined' ) {
1515 ( globalThis as any ) . window = globalThis ;
1616}
1717
You can’t perform that action at this time.
0 commit comments