Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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,
),
];
}, []);
{!loading ? (
) : (
<span>
)}
{!loading ? showDelta && (
) : (
<span>
)}
{!loading ? showBaselineValue && (
) : (
<span>
)}
</span></span></span>
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,
),
];
}, []);