From 1fc2c4afc0f3fbe6ddbb4ddcef79b7544d50d2a9 Mon Sep 17 00:00:00 2001 From: ocavue Date: Sun, 11 Feb 2024 03:02:09 +0800 Subject: [PATCH] add all built js files (after tsconfig change) --- esm/index.js | 2 +- esm/webcrypto.js | 3 +++ webcrypto.js | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/esm/index.js b/esm/index.js index 5a9cbf1..9a9d7ac 100644 --- a/esm/index.js +++ b/esm/index.js @@ -1,3 +1,3 @@ -"use strict"; throw new Error('noble-ciphers have no entry-point: consult README for usage'); +export {}; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/esm/webcrypto.js b/esm/webcrypto.js index b067413..ffb89ba 100644 --- a/esm/webcrypto.js +++ b/esm/webcrypto.js @@ -4,6 +4,9 @@ // 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. +// +// 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 { concatBytes } from './utils.js'; import { number } from './_assert.js'; diff --git a/webcrypto.js b/webcrypto.js index c77690b..32091b3 100644 --- a/webcrypto.js +++ b/webcrypto.js @@ -7,6 +7,9 @@ exports.gcm = exports.ctr = exports.cbc = exports.utils = exports.managedNonce = // 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. +// +// 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. const crypto_1 = require("@noble/ciphers/crypto"); Object.defineProperty(exports, "randomBytes", { enumerable: true, get: function () { return crypto_1.randomBytes; } }); Object.defineProperty(exports, "getWebcryptoSubtle", { enumerable: true, get: function () { return crypto_1.getWebcryptoSubtle; } });