Skip to content

Simplify and inline getPropertySymbolsFromType #25940

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

Merged
2 commits merged into from
Jul 26, 2018
Merged

Conversation

ghost
Copy link

@ghost ghost commented Jul 25, 2018

This function is only called in one place and can be simplified a lot.

@ghost ghost requested a review from sheetalkamat July 26, 2018 00:25
return flatMap(propSymbols, propSymbol => getDefinitionFromSymbol(typeChecker, propSymbol, node));
}
const propSymbols = name === undefined ? emptyArray : mapDefined(type.isUnion() ? type.types : [type], t => t.getProperty(name));
return flatMap(propSymbols, propSymbol => getDefinitionFromSymbol(typeChecker, propSymbol, node));
Copy link
Member

Choose a reason for hiding this comment

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

You dont need to create propSymbols as well right? You can just move this lambda above ?

@ghost ghost merged commit 673ae74 into master Jul 26, 2018
@ghost ghost deleted the getPropertySymbolsFromType branch July 26, 2018 18:52
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant