Just learned about Zod, a #TypeScript schema declaration and validation library


Just learned about Zod, a #TypeScript schema declaration and validation library. Zod is a simple way to validate API response shapes.

Declare a validator once, and Zod infers the type.

Zod throws an error when the data doesn’t match the schema. 👍
Yup is similar validation library. But Zod is unique because it throws an error when the data doesn't match the schema.

More on Zod vs Yup: https://blog.logrocket.com/comparing-schema-validation-libraries-zod-vs-yup/

View original on X