@lhci/utils
Advanced tools
Comparing version 0.1.1-alpha.3 to 0.1.1-alpha.4
{ | ||
"name": "@lhci/utils", | ||
"version": "0.1.1-alpha.3", | ||
"version": "0.1.1-alpha.4", | ||
"license": "Apache-2.0", | ||
@@ -15,3 +15,3 @@ "repository": { | ||
}, | ||
"gitHead": "4da32a1c9070c11322976f450d93debebff03fff" | ||
"gitHead": "45bf8a61a6b98d760e9cefeabfe1ba847b3718d5" | ||
} |
@@ -225,2 +225,17 @@ /** | ||
*/ | ||
function getNumericValue(audit) { | ||
if ( | ||
typeof audit.numericValue !== 'number' && | ||
audit.details && | ||
typeof audit.details.overallSavingsMs === 'number' | ||
) { | ||
return audit.details.overallSavingsMs; | ||
} | ||
return audit.numericValue; | ||
} | ||
/** | ||
* @param {LH.AuditResult} audit | ||
*/ | ||
function normalizeNumericValue(audit) { | ||
@@ -231,3 +246,3 @@ if (audit.scoreDisplayMode === 'notApplicable') { | ||
return audit.numericValue; | ||
return getNumericValue(audit); | ||
} | ||
@@ -265,3 +280,6 @@ | ||
if (typeof baseAudit.numericValue === 'number' || typeof compareAudit.numericValue === 'number') { | ||
if ( | ||
typeof getNumericValue(baseAudit) === 'number' || | ||
typeof getNumericValue(compareAudit) === 'number' | ||
) { | ||
diffs.push( | ||
@@ -268,0 +286,0 @@ createAuditDiff({ |
81369
1853