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

fix(types): correct typescript function headers #10404

Closed
wants to merge 2 commits into from
Closed

fix(types): correct typescript function headers #10404

wants to merge 2 commits into from

Conversation

matt-forster
Copy link
Contributor

Q                       A
Fixed Issues? Fixes #10403
Patch: Bug Fix? Yes
Major: Breaking Change? No
Minor: New Feature? No
Tests Added + Pass? -
Documentation PR Link -
Any Dependency Changes? No
License MIT

Flow maybe types state;

Maybe types accept the provided type as well as null or undefined. So ?number would mean number, null, or undefined.

So in this case, explicitly allow the type, null, or undefined in the
typescript definition.

Flow maybe types state;

> Maybe types accept the provided type as well as null or undefined. So ?number would mean number, null, or undefined.

So in this case, explicitly allow the type, null, or undefined in the
typescript definition.

Fixes #10403
Copy link
Contributor

@JLHwung JLHwung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@JLHwung JLHwung added the PR: Bug Fix 🐛 A type of pull request used for our changelog categories label Sep 6, 2019
@babel-bot
Copy link
Collaborator

babel-bot commented Sep 6, 2019

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/11500/

@babel-bot
Copy link
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/11499/

nicolo-ribaudo
nicolo-ribaudo previously approved these changes Sep 6, 2019
@nicolo-ribaudo nicolo-ribaudo dismissed their stale review September 6, 2019 20:09

I have re-cecked our source code and I think that it shouldn't be nullable. It's probably an error I introduced at

nicolo-ribaudo pushed a commit that referenced this pull request Sep 6, 2019
Flow maybe types state;

> Maybe types accept the provided type as well as null or undefined. So ?number would mean number, null, or undefined.

So in this case, explicitly allow the type, null, or undefined in the
typescript definition.

Fixes #10403
@nicolo-ribaudo
Copy link
Member

Merged as 15b63bc. Thank you!

@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Dec 6, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid Typescript Types in lib/index.d.ts since 7.6.0
4 participants