You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm a in use case where I can have tuple like that: [<1 empty>, "toto"]
In this case the safeParse method return a success with ["toto"] in result.data. Is this the expected behavior ?
I found no "simple" way to make the parser return an error. (Maybe by using .refine or by creating a custom rule)
* Add testcase - tuple as sparse array
* Destructure array to make .map() work properly - ZodTuple
* Make tuple as sparse array test more clear
* Add testcase - array as sparse array
* Destructure array to make .map() work properly - ZodArray
[Zod v.3.20.2]
Hello, I'm a in use case where I can have tuple like that:
[<1 empty>, "toto"]
In this case the safeParse method return a success with
["toto"]
inresult.data
. Is this the expected behavior ?I found no "simple" way to make the parser return an error. (Maybe by using .refine or by creating a custom rule)
Code to reproduce in RunKit
That said, it's a very usefull lib ;)
The text was updated successfully, but these errors were encountered: