-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Zod discriminated union discriminator value accepts zod enum #1213
Conversation
✅ Deploy Preview for guileless-rolypoly-866f8a ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
@colinhacks -- any thoughts? |
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. |
} else { | ||
throw new Error("Invalid types provided to ZodDiscriminatedUnion"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this runtime check and error here?
@@ -1603,7 +1603,9 @@ export type SomeZodObject = ZodObject< | |||
any | |||
>; | |||
|
|||
function deepPartialify(schema: ZodTypeAny): any { | |||
export function deepPartialify<T extends ZodTypeAny>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be a better to split off this update to deepPartialify
since it's not necessary for the rest of the work here.
Hello @tianhuil @scotttrinh ! I'm wondering if this is still being worked on? It seems that the PR's feature already works. Just asking because I ran into this while implementing #1589. |
@scotttrinh / @maxArturo: I'm happy to resubmit with just the changes concerning |
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. |
Zod discriminated union discriminator value accepts zod enum:
Updates test, README.md documentation, and some minor changes from lint / prettier.
Requested in #1075 and #1015.