-
-
Notifications
You must be signed in to change notification settings - Fork 349
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
TypeScript error: Argument of type '"string"' is not assignable to parameter of type '"oct"'
To Reproduce
Steps to reproduce the behaviour:
- create a keystore with
new jose.JWT.KeyStore()
- create a type alias
type Algorithm = "RSA" | "EC" | "OKP" | "oct";
- create a function
generateKey
:
function generateKey(alg: Algorithm) {
return keystore.generateSync(alg, "P-256");
}
Reproduction link: https://codesandbox.io/s/laughing-shockley-hlpr1?file=/src/index.ts
Expected behaviour
Expect no error with type checking
Environment:
jose
version: v1.26.0- node version: v12.13.1
Additional context
Add any other context about the problem here.
- the bug is happening on latest
jose
too. - i have searched the issues tracker on github for similar issues and couldn't find anything related.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working