From 16279652a67133fba0db7c9879767f000a8f1662 Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Mon, 2 Oct 2023 15:24:44 +0200 Subject: [PATCH] fix: resolve missing types for the cryptoRuntime const --- src/index.ts | 3 ++- src/runtime/browser/runtime.ts | 4 +--- src/runtime/node/runtime.ts | 4 +--- src/util/runtime.ts | 3 +++ 4 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 src/util/runtime.ts diff --git a/src/index.ts b/src/index.ts index aa008ab6d3..f0a0f4e019 100644 --- a/src/index.ts +++ b/src/index.ts @@ -95,6 +95,7 @@ export type { CompactJWSHeaderParameters, JWTHeaderParameters, JSONWebKeySet, + CryptoRuntime, } from './types.d' -export { default as cryptoRuntime } from './runtime/runtime.js' +export { default as cryptoRuntime } from './util/runtime.js' diff --git a/src/runtime/browser/runtime.ts b/src/runtime/browser/runtime.ts index b1c305748f..0c7d6bc3cd 100644 --- a/src/runtime/browser/runtime.ts +++ b/src/runtime/browser/runtime.ts @@ -1,3 +1 @@ -import { CryptoRuntime } from '../../types.d' - -export default 'WebCryptoAPI' as CryptoRuntime +export default 'WebCryptoAPI' diff --git a/src/runtime/node/runtime.ts b/src/runtime/node/runtime.ts index 1379e59835..4e84778ef0 100644 --- a/src/runtime/node/runtime.ts +++ b/src/runtime/node/runtime.ts @@ -1,3 +1 @@ -import { CryptoRuntime } from '../../types.d' - -export default 'node:crypto' as CryptoRuntime +export default 'node:crypto' diff --git a/src/util/runtime.ts b/src/util/runtime.ts new file mode 100644 index 0000000000..dd0fc264bd --- /dev/null +++ b/src/util/runtime.ts @@ -0,0 +1,3 @@ +import value from '../runtime/runtime.js' +import type { CryptoRuntime } from '../types.d' +export default value as CryptoRuntime