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
Hm yeah, it's definitely an oversight to not include errorMap anywhere in the main README. I think I was hesitant to document error maps too visibly since they're a comparatively advanced feature and might feel intimidating to some users. I'll work on this.
The other two params aren't really intended for direct use and should probably be hidden from the public API.
Schema method
.parse()
accepts an optional second argumentparams
.I've found it very useful, especially
errorMap
property.The usage is described in https://github.com/colinhacks/zod/blob/main/ERROR_HANDLING.md.
Unfortunately, in the
.parse()
documentation theparams
is not mentioned, see https://zod.dev/?id=parseI think this just hide a very useful feature.
Would be nice to add
params
to.parse()
documentation, or at least mention it and linkERROR_HANDLING.md
The text was updated successfully, but these errors were encountered: