-
-
Notifications
You must be signed in to change notification settings - Fork 615
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
Fix error where property 'value' does not exist on type 'ValidationError’ #794
Fix error where property 'value' does not exist on type 'ValidationError’ #794
Conversation
This fixes the error when accessing property 'value' in union object type 'ValidationError’ for properties not defined on all union members.
a7be566
to
f4b7399
Compare
@gustavohenke could you please review this PR when you are free? Thanks! |
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 made a slight change for type safety. How does it look?
Looks good to me, thanks for the improvement for type safety. @gustavohenke |
Shipped in v6.3.0! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What went wrong?
Accessing property in union of object types fails for properties not defined on all union members.
Proposed Fix
Add optional types to all validation error fields for each union member. Fixes #795.
Related Issue
microsoft/TypeScript#12815
Environment
TypeScript v3.7.2