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

core(tsc): fancier displayValue type #5111

Merged
merged 1 commit into from
May 4, 2018
Merged

core(tsc): fancier displayValue type #5111

merged 1 commit into from
May 4, 2018

Conversation

brendankenny
Copy link
Member

@brendankenny brendankenny commented May 4, 2018

tsc wasn't inferring the correct type for displayValue in #5099 (widening it to just Array<string | number> which doesn't fit our requirement that the first element always be a string). It turns out this was because it was losing track of the more specific array type when passing back up the promise chain.

Flattening execution a bit with async/await and it can track the more specific type again :)

Diff is relatively tiny if you look at ?w=1

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

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

woo! 🌮

@paulirish paulirish changed the title core(displayValue): fancier displayValue type core(types): fancier displayValue type May 4, 2018
@brendankenny brendankenny changed the title core(types): fancier displayValue type core(tsc): fancier displayValue type May 4, 2018
@brendankenny brendankenny merged commit b49e6ce into master May 4, 2018
@brendankenny brendankenny deleted the displayvalue branch May 4, 2018 04:28
kdzwinel pushed a commit to kdzwinel/lighthouse that referenced this pull request Aug 16, 2018
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.

3 participants