Skip to content

Commit

Permalink
Review fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kigawas committed Aug 15, 2023
1 parent 89dcfdf commit 5521802
Show file tree
Hide file tree
Showing 4 changed files with 763 additions and 824 deletions.
2 changes: 1 addition & 1 deletion src/webcrypto/crypto.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.
// See utils.ts for details.
declare const globalThis: Record<string, any> | undefined;
export const crypto: Crypto =
export const crypto =
typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined;
2 changes: 1 addition & 1 deletion src/webcrypto/cryptoNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
// The file will throw on node.js 14 and earlier.
// @ts-ignore
import * as nc from 'node:crypto';
export const crypto: Crypto =
export const crypto =
nc && typeof nc === 'object' && 'webcrypto' in nc ? (nc.webcrypto as any) : undefined;
Loading

0 comments on commit 5521802

Please sign in to comment.