Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: #1602 narrow superRefine() type #1615

Merged

Conversation

maxArturo
Copy link
Contributor

Closes #1602.

Adds TS overloads for ZodType.superRefine() such that, if provided with a type predicate function, the signature of the returning ZodEffects type will be narrowed.

Users are still expected to call ctx.addIssue() as per the current API. Tests and docs updated.

@netlify
Copy link

netlify bot commented Nov 29, 2022

Deploy Preview for guileless-rolypoly-866f8a ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 3628017
🔍 Latest deploy log https://app.netlify.com/sites/guileless-rolypoly-866f8a/deploys/638668e42564000008893c09
😎 Deploy Preview https://deploy-preview-1615--guileless-rolypoly-866f8a.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@maxArturo maxArturo marked this pull request as ready for review November 29, 2022 20:18
@colinhacks colinhacks merged commit 497d44b into colinhacks:master Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a way for .superRefine() to narrow down the output type
2 participants