From 999a373c7ac2fd5c325f44156f0b23853542daec Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Sun, 13 Oct 2024 18:22:39 +0200 Subject: [PATCH] refactor: update assertCryptoKey error message --- src/index.ts | 2 +- test/client_auth.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 670e705f..ee996f4d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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) } } diff --git a/test/client_auth.test.ts b/test/client_auth.test.ts index e6ec778a..f755c2d7 100644 --- a/test/client_auth.test.ts +++ b/test/client_auth.test.ts @@ -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() })