sd-jwt-js
sd-jwt-js copied to clipboard
Feat: add zod for object validation
Using zod could help to validate objects before dealing with them. This should be implemented for all packages where required
Can you tell me what examples there are?
It would help to validate variables. So instead of
if(jwk.exp && typeof jwk.exp === number) {
}
you could go with
const schema = z.number();
schema.parse(jwk.exp)
While I think ZOD is nice, I do not see so many values that we need to type check for validation (Timo brought the topic up in one of the issues)