Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Oct 3, 2021
1 parent eda30f3 commit 96f34c4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/combination/ids.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,10 @@ export const hasSameCombinationIds = function (combinationA, combinationB) {
}

// Retrieve each dimension's id of a given combination
// Does not follow `DIMENSIONS` array order.
// Follows `DIMENSIONS` array order.
export const getCombinationIds = function (combination) {
return Object.values(combination.dimensions).map(getCombinationId)
}

const getCombinationId = function ({ id }) {
return id
const dimensions = getCombDimensions(combination)
return dimensions.map(
(dimension) => combination.dimensions[dimension.propName].id,
)
}

0 comments on commit 96f34c4

Please sign in to comment.