Colin McDonnell

Results 258 comments of Colin McDonnell

Zod's currently policy is to let errors in refinements, transforms, and preprocess propagate up the call stack. The goal of ZodError is to expose validation errors. In my opinion, an...

It's pretty rakey, but I've personally never seen Zod's `undefined` beat out the built-in in autocomplete. If this is happening for a non-trivial fraction of users, it's something that should...

I did not. The point is that this code should throw an error when I try to pass a `ZodObject` as the key, but it doesn't.

This seems good to me. Is there a specific reason this is still a draft PR? My plan is to merge this into `v4`. String validations like `uuid`, etc are...

Thanks for this! I've replicated and work on this for Zod 4.

I described a similar scenario here: https://github.com/colinhacks/zod/issues/3429#issuecomment-2071816685 It seems to be related to the recursive definition of ZodError. As far as I can tell this isn't related to Zod 3.23...

My goal was for `ZodUnion` to have a strongly typed tuple containing the element schemas. The current type signature is designed to prevent things like your `TILES.map()` call, because then...

Hm. I think that's a good idea generally but not in your particular case. Since you're trying to enforce an "OR" condition, you should just use `ZodIssueCode.invalid_type`. By contrast `invalid_string`...

Not really. You can do `z.instanceof(FormData)` but that's about it. I've considered a `z.formdata()` API that would let you specify whether to `.get()` or `.getAll()` each field. Then you're left...