Is using zod for type narrowing fine solution?
Is using parse for type narrowing good idea with decent performance or should I make validation functions for objects?
1 Reply
If you generally trust the data that's coming from your db, you can safely use e.g. type predicates to narrow the data further. This should usually be faster.
But if you always have only a small dataset to check, use whatever gives the best DX imo.