Colin McDonnell
Colin McDonnell
This syntax is already implementable without `const`, that's not the problem. It's just a footgun that will cause users frustration. This is the part that makes this syntax a footgun,...
Thanks for the excellent PR here, and apologies for taking so long to address it. At the moment, I'm trying to keep Zod's core feature set as small as possible;...
Added you guys back before I saw this! Thanks Daniel!
It's unfortunate but intended. The `required_error` and `invalid_type_error` fields are somewhat hacky ways to set custom error messages for some common issue codes. I'm considering adding a simpler way to...
Love it, thanks!!!
## RFC for datetime methods The hard problem here is naming the methods such that the validation behavior is clear to everyone. I'm opposed to adding a method called `.datetime()`...
I don't know how to implement `addMethod` such that TypeScript is aware of the new method. Since TypeScript isn't aware of the method there would (rightfully) be a SyntaxError if...
The general approach works but there are some problems with this implementation. You'd have to return an instance of `MyStringClass` from the `static create` factory. Here's a working implementation: ```ts...
Support for a configurable `z.string().datetime()` has landed in Zod 3.20. https://github.com/colinhacks/zod/releases/tag/v3.20 ### `z.string().datetime()` A new method has been added to `ZodString` to validate ISO datetime strings. Thanks @samchungy! ```ts z.string().datetime();...
Yep I agree, though some people will be annoyed - the same set that are annoyed that `z.object` also strips unknown keys by default. We'll need to add `.strict` and...