Colin McDonnell

Results 258 comments of Colin McDonnell

Thanks Gabriel. I think if we were going to support a function here, it should conform to the `ZodErrorMap` interface. Essentially you'd be providing an error map that would be...

It's a nice idea, but there's no way to represent these "NOT" types in TypeScript so it isn't likely. It's important that Zod's inferred types accurately reflect what will pass...

@throw5way Interesting idea. The `.safeParse()` method could be modified such that a successful result also includes a ZodError with any caught errors. I think that would address your use case....

Thanks for the writeup, good stuff. 👍 Since you're primarily interested in logging, know that `.catch()` can also accept a function that will be executed at parse-time. This isn't totally...

This is unfortunately not a solvable problem in the general case. Errors can arise at any point in the parsing pipeline. You can chain together an arbitrary chain of schemas...

This will be fixed in Zod 4 per https://github.com/colinhacks/zod/pull/2441#issuecomment-2044094604 Leaving open until then.

As noted, this is an issue with the Bun runtime, feel free to close @B4nan 👍 This can be tracked here: https://github.com/oven-sh/bun/issues/5606

This has landed in Zod 3.23. https://github.com/colinhacks/zod/releases/tag/v3.23.0

Thanks for the effort you put into this benchmark! I'm broadly aware of this and am working on solutions in Zod 4. There are some very obvious performance in Zod's...