Skip to content

Commit e00f273

Browse files
committed
refactor: hardcode the cryptoRuntime export since it is now always WebCryptoAPI
1 parent 2fae1c4 commit e00f273

File tree

4 files changed

+2
-42
lines changed

4 files changed

+2
-42
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,4 @@ export type {
106106
GetKeyFunction,
107107
} from './types.d.ts'
108108

109-
export { default as cryptoRuntime } from './util/runtime.js'
109+
export const cryptoRuntime = 'WebCryptoAPI'

src/util/runtime.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

tap/cookbook.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export default (
148148
}
149149

150150
function supported(vector: any) {
151-
if (vector.webcrypto === false && lib.cryptoRuntime !== 'node:crypto') {
151+
if (vector.webcrypto === false) {
152152
return false
153153
}
154154
if (env.isElectron && vector.electron === false) {

tap/jwk.ts

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -101,41 +101,4 @@ export default (
101101
})
102102
}
103103
}
104-
105-
// test('alg argument and jwk.alg is ignored for oct JWKs', async (t) => {
106-
// const oct = {
107-
// k: 'FyCq1CKBflh3I5gikEjpYrdOXllzxB_yc02za8ERknI',
108-
// kty: 'oct',
109-
// }
110-
// await lib.importJWK(oct)
111-
// t.ok(1)
112-
// })
113-
114-
// if (lib.cryptoRuntime === 'node:crypto') {
115-
// test('alg argument is ignored if jwk does not have alg for asymmetric keys', async (t) => {
116-
// const jwk = {
117-
// kty: 'EC',
118-
// crv: 'P-256',
119-
// x: 'jJ6Flys3zK9jUhnOHf6G49Dyp5hah6CNP84-gY-n9eo',
120-
// y: 'nhI6iD5eFXgBTLt_1p3aip-5VbZeMhxeFSpjfEAf7Ww',
121-
// }
122-
// await lib.importJWK(jwk)
123-
// t.ok(1)
124-
// })
125-
// } else {
126-
// test('alg argument must be present if jwk does not have alg for asymmetric keys', async (t) => {
127-
// const jwk = {
128-
// kty: 'EC',
129-
// crv: 'P-256',
130-
// x: 'jJ6Flys3zK9jUhnOHf6G49Dyp5hah6CNP84-gY-n9eo',
131-
// y: 'nhI6iD5eFXgBTLt_1p3aip-5VbZeMhxeFSpjfEAf7Ww',
132-
// }
133-
// await t.rejects(
134-
// lib.importJWK(jwk),
135-
// '"alg" argument is required when "jwk.alg" is not present',
136-
// )
137-
// await lib.importJWK(jwk, 'ES256')
138-
// await lib.importJWK({ ...jwk, alg: 'ES256' })
139-
// })
140-
// }
141104
}

0 commit comments

Comments
 (0)