Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
{sortedItems.map(({base, compare, diffs}) => {
const definedItem = compare || base;
// This should never be true, but make tsc happy
if (!definedItem) return null;
const key = `${base && base.index}-${compare && compare.index}`;
const state = getRowLabelForIndex(
allDiffs,
compare && compare.index,
base && base.index
);
return (
{headings.map((heading, j) => {
const itemType = heading.valueType || heading.itemType || 'unknown';
const diff = diffs.find(
/** @return {diff is LHCI.NumericItemAuditDiff} */
diff => diff.type === 'itemDelta' && diff.itemKey === heading.key
);
return (
.map(pair => getRowLabelForIndex(diffs, pair.compare, pair.base))
.map(getDiffLabelForRowLabel);