From 70b52a412311db7f6b874bbbf8f80b7dbe149e58 Mon Sep 17 00:00:00 2001 From: ocavue Date: Sat, 10 Feb 2024 20:43:49 +0800 Subject: [PATCH] Fix test --- src/webcrypto.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/webcrypto.ts b/src/webcrypto.ts index db85c53..001f7c5 100644 --- a/src/webcrypto.ts +++ b/src/webcrypto.ts @@ -4,7 +4,10 @@ // from `crypto` to `cryptoNode`, which imports native module. // Makes the utils un-importable in browsers without a bundler. // Once node.js 18 is deprecated, we can just drop the import. -import { randomBytes, getWebcryptoSubtle } from './crypto.js'; +// +// Use full path so that Node.js can rewrite it to `cryptoNode.js`. +// @ts-ignore: `tsc` doesn't understand `@noble/ciphers/crypto` is a valid import. +import { randomBytes, getWebcryptoSubtle } from '@noble/ciphers/crypto'; import { Cipher, concatBytes } from './utils.js'; import { number } from './_assert.js'; import { AsyncCipher } from './utils.js';