Hacker News new | ask | show | jobs
by panzerklein 1748 days ago
You can write validation schemas using zod library [1]. They end up looking pretty similar to typescript definitions (same vocabulary, same methods for combining/intersecting/filtering). And if you migrate to typescript you'll get type definitions for free out of those schemas.

[1] https://github.com/colinhacks/zod

1 comments

If you like zod, you should check out myzod: https://github.com/davidmdm/myzod