jose 6.1.1 → 6.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,7 +9,7 @@ function isCloudflareWorkers() {
|
|
|
9
9
|
let USER_AGENT;
|
|
10
10
|
if (typeof navigator === 'undefined' || !navigator.userAgent?.startsWith?.('Mozilla/5.0 ')) {
|
|
11
11
|
const NAME = 'jose';
|
|
12
|
-
const VERSION = 'v6.1.
|
|
12
|
+
const VERSION = 'v6.1.2';
|
|
13
13
|
USER_AGENT = `${NAME}/${VERSION}`;
|
|
14
14
|
}
|
|
15
15
|
export const customFetch = Symbol();
|
|
@@ -3,6 +3,15 @@ export function assertCryptoKey(key) {
|
|
|
3
3
|
throw new Error('CryptoKey instance expected');
|
|
4
4
|
}
|
|
5
5
|
}
|
|
6
|
-
export const isCryptoKey = (key) =>
|
|
6
|
+
export const isCryptoKey = (key) => {
|
|
7
|
+
if (key?.[Symbol.toStringTag] === 'CryptoKey')
|
|
8
|
+
return true;
|
|
9
|
+
try {
|
|
10
|
+
return key instanceof CryptoKey;
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
7
16
|
export const isKeyObject = (key) => key?.[Symbol.toStringTag] === 'KeyObject';
|
|
8
17
|
export const isKeyLike = (key) => isCryptoKey(key) || isKeyObject(key);
|