We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
global.require
1 parent 48cb7b5 commit 6ec5c89Copy full SHA for 6ec5c89
packages/utilities/src/hmac.ts
@@ -41,9 +41,8 @@ let subtleCrypto = globalThis.crypto?.subtle;
41
42
async function ensureSubtleCryptoExists() {
43
if (!subtleCrypto) {
44
- if (require) {
45
- // eslint-disable-next-line @typescript-eslint/no-require-imports, global-require -- Backward compatibility for Node.js versions < 19
46
- subtleCrypto = require('node:crypto')?.webcrypto?.subtle;
+ if (globalThis.require) {
+ subtleCrypto = globalThis.require('node:crypto')?.webcrypto?.subtle;
47
} else {
48
subtleCrypto = (await import('node:crypto'))?.webcrypto?.subtle as SubtleCrypto;
49
}
0 commit comments