From 2b34b1ad2f276064c33b3a17a4d0db164f38d867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Iv=C3=A1n=20Vieitez=20Parra?= <3857362+corrideat@users.noreply.github.com> Date: Sat, 28 Oct 2023 23:07:26 +0200 Subject: [PATCH] Move webcrypto to a string --- src/untrusted/lib/nodejsLoadWebcrypto.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/untrusted/lib/nodejsLoadWebcrypto.ts b/src/untrusted/lib/nodejsLoadWebcrypto.ts index 404b3d7..a546969 100644 --- a/src/untrusted/lib/nodejsLoadWebcrypto.ts +++ b/src/untrusted/lib/nodejsLoadWebcrypto.ts @@ -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,