Closed kschaefe closed 1 year ago
Per your guidelines, I have filed this to open a discussion before submitting a PR to fix this problem.
If interested the branch with the failing test for the current code and the fixes is https://github.com/CarnegieLearningWeb/paseto/tree/bugfix/correct-object-types.
@kschaefe feel free to submit the PR, feedback to be continued in the PR ;)
Fixed by #36
What happened?
With TypeScript strict checking enabled (https://www.typescriptlang.org/tsconfig#strict),
decrypt
returns a type that causes compilation errors.I would expect that indexed access would work and that the code should compile.
Changing the return from
Promise<object>
toPromise<Record<PropertyKey, unknown>>
would allow indexed access.Version
v3.1.1
Node.js Version
v16.13.0
Code to reproduce
Required