Skip to content

pr#11230

Merged
connorjclark merged 1 commit into
cls-budgetfrom
cls-budget-2
Aug 6, 2020
Merged

pr#11230
connorjclark merged 1 commit into
cls-budgetfrom
cls-budget-2

Conversation

@connorjclark

Copy link
Copy Markdown
Collaborator

No description provided.

@connorjclark connorjclark requested a review from Beytoven August 6, 2020 19:04
@connorjclark connorjclark requested a review from a team as a code owner August 6, 2020 19:04
// CLS requires a different granularity.
const clsItem = items.find(item => item.metric === 'cumulative-layout-shift');
if (clsItem) {
if (typeof clsItem.measurement !== 'object') {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

object if is not necessary, but it narrows the type to number|undefined and so is a bit safer, even tho Number(object) would still pass type check

@connorjclark connorjclark merged commit f2736ea into cls-budget Aug 6, 2020
@connorjclark connorjclark deleted the cls-budget-2 branch August 6, 2020 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants