How to use the @bundle-stats/utils.formatDelta function in @bundle-stats/utils

To help you get started, we’ve selected a few @bundle-stats/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 relative-ci / bundle-stats / packages / ui / src / utils / compute-delta.js View on Github external
const getRunsDelta = runs => runs.reduce((aggregator, run, index) => {
  const deltaInfo = {};

  if (index < runs.length - 1) {
    deltaInfo.delta = getDelta(runs[index + 1], run);
    deltaInfo.displayDelta = formatDelta(deltaInfo.delta);
  }

  return [
    ...aggregator,
    merge(
      run,
      deltaInfo,
    ),
  ];
}, []);
github relative-ci / bundle-stats / packages / ui / src / components / summary-item / summary-item.jsx View on Github external
{!loading ? (
        
      ) : (
        <span>
      )}

      {!loading ? showDelta &amp;&amp; (
        
      ) : (
        <span>
      )}

      {!loading ? showBaselineValue &amp;&amp; (
        
      ) : (
        <span>
      )}
</span></span></span>
github relative-ci / bundle-stats / packages / web-compare / src / utils / compute-delta.js View on Github external
const getRunsDelta = runs => runs.reduce((aggregator, run, index) => {
  const deltaInfo = {};

  if (index > 0) {
    deltaInfo.delta = getDelta(runs[index - 1], run);
    deltaInfo.displayDelta = formatDelta(deltaInfo.delta);
  }

  return [
    ...aggregator,
    merge(
      run,
      deltaInfo,
    ),
  ];
}, []);