3 ms·
There is also class-validator, which I've used and I find elegant and working well: https://github.com/typestack/class-validator https://github.com/typestack/c
by random_savv 7y ago
There is also class-validator, which I've used and I find elegant and working well:
https://github.com/typestack/class-validator https://github.com/typestack/class-validator
- colinmcd 7y agoHuh, not sure how I missed this. I don't love the class-based declarations: it's a bit verbose and doesn't allow you to use things like the spread operator to "mix in" fields into objects. There's also some redundancy required for basic types: @IsString firstName: string; For my purposes, I also needed support for recursive types, unions, and intersections, which I don't believe are supported. But their validation built-ins go way beyond Zod (IsEmail, Min, Max, Contains, native Date support, etc). Thanks for sharing.