Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Sep 5, 2021
1 parent 5702fef commit 740e22f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/report/reporters/boxplot/normalize.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@ import mapObj from 'map-obj'

// Normalize combinations, including turning the `quantiles` array instead an
// object with only the quantiles we need
export const normalizeQuantiles = function ({ titles, stats: { quantiles } }) {
export const normalizeQuantiles = function ({
stats: { quantiles },
...combination
}) {
if (quantiles === undefined) {
return { titles }
return combination
}

const quantilesA = mapObj(QUANTILES, (name, quantileIndex) => [
name,
quantiles[quantileIndex],
])
return { titles, quantiles: quantilesA }
return { ...combination, quantiles: quantilesA }
}

// List of quantiles shown by the reporter
Expand Down

0 comments on commit 740e22f

Please sign in to comment.