zod
zod copied to clipboard
feat: add index signature inference when using `passthrough` on ZodObjects
Overview
As we know, the passthrough
option allows any key to, as the name suggests, pass through the parser.
This PR adds a { [k: string] any }
index signature on the Zod Objects marked as passthrough
. (because that's what happens in reality, right?)
If you declare a catchall
, though, the catchall
has priority over it (as says the docs and the code) so the inference caused by the passthrough
option goes away.

Deploy Preview for guileless-rolypoly-866f8a failed.
Built without sensitive environment variables
Name | Link |
---|---|
Latest commit | 9bd4e14db822dfdadbc0ce801eae50413002702f |
Latest deploy log | https://app.netlify.com/sites/guileless-rolypoly-866f8a/deploys/6398b5f0e63dde00091b71f7 |
Deploy Preview for guileless-rolypoly-866f8a ready!
Built without sensitive environment variables
Name | Link |
---|---|
Latest commit | 9aafad8022c85fa3b518033cb3718fcdf20babd9 |
Latest deploy log | https://app.netlify.com/sites/guileless-rolypoly-866f8a/deploys/639bb63e35bbea0009c7deb0 |
Deploy Preview | https://deploy-preview-1688--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 settings.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.