Skip to content

Commit

Permalink
Move webcrypto to a string
Browse files Browse the repository at this point in the history
  • Loading branch information
corrideat committed Oct 28, 2023
1 parent b0078d5 commit 2b34b1a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/untrusted/lib/nodejsLoadWebcrypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ if (
!('crypto' in globalThis) &&
typeof require === 'function'
) {
// Please CC
const webcrypto_s = 'webcrypto';
// eslint-disable-next-line @typescript-eslint/no-var-requires
const webcrypto = require('node:crypto')['webcrypto'];
const webcrypto = require('node:crypto')[webcrypto_s];
if (webcrypto) {
Object.defineProperty(globalThis, 'crypto', {
['enumerable']: true,
Expand Down

0 comments on commit 2b34b1a

Please sign in to comment.