Hacker News new | past | comments | ask | show | jobs | submit login

This is why you need input validation. Eg, zod or io-ts.



Did not know about these. I wrote my own a while back because I couldn't find an example of this being done (fully type safe validation).

https://github.com/cjdell/type-safe-validator


Not exactly the same thing, but protobuf.js also works really well for this: https://github.com/protobufjs/protobuf.js




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: