Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Commit

Permalink
Fix check for undefined globalThis
Browse files Browse the repository at this point in the history
  • Loading branch information
larabr committed Feb 29, 2024
1 parent 08a95ae commit c8df197
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export function equalUint8Array(x: Uint8Array, y: Uint8Array) {
}

export async function loadCrypto(): Promise<Crypto> {
if (globalThis !== undefined && globalThis.crypto !== undefined) {
if (typeof globalThis !== 'undefined' && globalThis.crypto !== undefined) {
// Browsers, Node.js >= v19, Cloudflare Workers, Bun, etc.
return globalThis.crypto;
}
Expand Down

0 comments on commit c8df197

Please sign in to comment.