zod
zod copied to clipboard
fix: use the custom error message correctly
trafficstars
fix https://github.com/colinhacks/zod/issues/3675
Error messages provided by the user should have the highest priority, so if they exist, they can be used directly.
Deploy Preview for guileless-rolypoly-866f8a ready!
Built without sensitive environment variables
| Name | Link |
|---|---|
| Latest commit | 4b94fbc8a9c7ed35dbeeba672147f8e04fbac92a |
| Latest deploy log | https://app.netlify.com/sites/guileless-rolypoly-866f8a/deploys/66cf024412e6d50008e86d63 |
| Deploy Preview | https://deploy-preview-3728--guileless-rolypoly-866f8a.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
What's the conceptual difference?
Under this condition if (iss.code !== "invalid_type"), zod won't display user's custom message.
Can you add some tests for this change?