-
Notifications
You must be signed in to change notification settings - Fork 141
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
Support exactOptionalPropertyTypes
in TypeScript
#1138
Comments
@mrmckeb makes sense, happy to accept a PR here. Thanks! |
I took a look at this and I see two options:
Either option will likely require more changes over time, as option 1 still won't prevent new code from being added that doesn't include What do you think @silesky? |
@mrmckeb -- definitely the one with the least amount of code changes, that ideally only touches the public APIs (i.e. Params). Thanks! |
This is a quick change, and I'm happy to contribute.
When using TypeScript with
exactOptionalPropertyTypes
, we get errors because Segment types don't allowundefined
to be supplied to optional values.The fix is that whenever a type is optional, it should also allow undefined.
As an example:
The text was updated successfully, but these errors were encountered: