[go: nahoru, domu]

Skip to content

Commit

Permalink
refactor: normalize is always defined for Web API runtimes
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Jun 27, 2024
1 parent fcfe0c6 commit 7bcb103
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/runtime/browser/get_sign_verify_key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@ import { types } from './is_key_like.js'
import * as normalize from '../normalize_key.js'

export default async function getCryptoKey(alg: string, key: unknown, usage: KeyUsage) {
// @ts-ignore
if (normalize.normalizePrivateKey && usage === 'sign') {
// @ts-ignore
if (usage === 'sign') {
key = await normalize.normalizePrivateKey(key, alg)
}

// @ts-ignore
if (normalize.normalizePublicKey && usage === 'verify') {
// @ts-ignore
if (usage === 'verify') {
key = await normalize.normalizePublicKey(key, alg)
}

Expand Down

0 comments on commit 7bcb103

Please sign in to comment.