-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 for typeof
aliasing
#2339
Comments
Sounds like a duplicate of #34 |
Yeah, this is a duplicate so I'm going to close in favor of that issue. @wessberg feel free to subscribe there. This is something we're actively working on so you can expect an announcement in that issue soon. :) |
I'm getting this behaviour when using Lodash isString module: declarations declare module 'lodash.isstring' {
declare function exports(value: any): boolean;
} src.js parse: (value: Object|string): Object => {
let query: Object|string = {};
if (isString(value)) {
query = url.parse(value, true).query;
}
...
} Error:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Consider the following scenario:
It would be preferable if flow understood that we already did the type check. For instance, consider a scenario where type
typeof
selector simply isn't enough:We could solve it by writing:
But that's pretty boilerplatey and screams for a helper method.
So, my request is:
typeof
/instanceof
expressions?The text was updated successfully, but these errors were encountered: