Skip to content

Commit 6ec5c89

Browse files
committed
chore: use global.require explicitly
1 parent 48cb7b5 commit 6ec5c89

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/utilities/src/hmac.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ let subtleCrypto = globalThis.crypto?.subtle;
4141

4242
async function ensureSubtleCryptoExists() {
4343
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;
44+
if (globalThis.require) {
45+
subtleCrypto = globalThis.require('node:crypto')?.webcrypto?.subtle;
4746
} else {
4847
subtleCrypto = (await import('node:crypto'))?.webcrypto?.subtle as SubtleCrypto;
4948
}

0 commit comments

Comments
 (0)