Skip to content

Commit

Permalink
refactor: update assertCryptoKey error message
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Oct 13, 2024
1 parent a21fd32 commit 999a373
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ function OPE(message: string, code?: string, cause?: unknown) {

function assertCryptoKey(key: unknown, it: string): asserts key is CryptoKey {
if (!(key instanceof CryptoKey)) {
throw CodedTypeError(`${it} must be a private CryptoKey`, ERR_INVALID_ARG_TYPE)
throw CodedTypeError(`${it} must be a CryptoKey`, ERR_INVALID_ARG_TYPE)
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/client_auth.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ test('private_key_jwt', async (t) => {
message: '"clientPrivateKey.key" must be a private CryptoKey',
})
t.throws(() => lib.PrivateKeyJwt({ key: null as any }), {
message: '"clientPrivateKey.key" must be a private CryptoKey',
message: '"clientPrivateKey.key" must be a CryptoKey',
})
t.pass()
})
Expand Down

0 comments on commit 999a373

Please sign in to comment.