Thanks for the post! Zod looks like an interesting tool when you have strict schemas (which you really should!).
There is an error in your example in Assertions that uses typeof. typeof always returns a string.
// Current: typeof will never return Dateif(typeofdata.birthDate!==Date){// Always use string comparisons for typeofif (typeofdata.birthDate!=='date'){
Thanks for the post! Zod looks like an interesting tool when you have strict schemas (which you really should!).
There is an error in your example in Assertions that uses
typeof. typeof always returns a string.Oops! Thanks for noticing that 😅
I didn't think about that
typeofreturning'object'for Dates! We should be able to usedata.birthDate instanceof Datefor this. 😬