How to use the @lhci/utils/src/audit-diff-finder.getRowLabelForIndex function in @lhci/utils

To help you get started, we’ve selected a few @lhci/utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GoogleChrome / lighthouse-ci / packages / server / src / ui / routes / build-view / audit-detail / table-details.jsx View on Github external
{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 (
github GoogleChrome / lighthouse-ci / packages / server / src / ui / routes / build-view / audit-list / audit-diff.jsx View on Github external
    .map(pair => getRowLabelForIndex(diffs, pair.compare, pair.base))
    .map(getDiffLabelForRowLabel);