Skip to content

Commit

Permalink
refactor: CryptoKey normalization is not always async
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Jun 27, 2024
1 parent 1c8c0d3 commit b7751f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/runtime/browser/normalize_key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import importJWK from '../jwk_to_key.js'

const normalizeSecretKey = (k: string) => decode(k)

const normalizePublicKey = async (key: KeyLike | Uint8Array | unknown, alg: string) => {
const normalizePublicKey = (key: KeyLike | Uint8Array | unknown, alg: string) => {
// @ts-expect-error
if (key?.[Symbol.toStringTag] === 'KeyObject') {
// @ts-expect-error
Expand All @@ -25,7 +25,7 @@ const normalizePublicKey = async (key: KeyLike | Uint8Array | unknown, alg: stri
return <KeyLike | Uint8Array>key
}

const normalizePrivateKey = async (key: KeyLike | Uint8Array | unknown, alg: string) => {
const normalizePrivateKey = (key: KeyLike | Uint8Array | unknown, alg: string) => {
// @ts-expect-error
if (key?.[Symbol.toStringTag] === 'KeyObject') {
// @ts-expect-error
Expand Down

0 comments on commit b7751f5

Please sign in to comment.