Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Sep 12, 2021
1 parent edc512d commit 5f48979
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/combination/dimensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ export const N_COMBINATION_DIMENSIONS = [
getIds: getInputIds,
},
]

// Dimensions created by users, not by plugins
export const USER_DIMENSIONS = new Set(['task', 'system', 'input'])
9 changes: 3 additions & 6 deletions src/combination/ids.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ import { titleColor, noteColor } from '../report/utils/colors.js'
import {
COMBINATION_DIMENSIONS,
N_COMBINATION_DIMENSIONS,
USER_DIMENSIONS,
} from './dimensions.js'

// Retrieve user-defined identifiers: tasks, systems, variations, inputs
// They are checked for allowed characters.
// As opposed to plugin-defined identifiers: runners
// Retrieve user-defined identifiers
export const getUserIds = function (combinations, inputs) {
const combinationsIds = getCombinationsIds(combinations)
const nonCombinationIds = getNonCombinationsIds(inputs)
Expand All @@ -16,11 +15,9 @@ export const getUserIds = function (combinations, inputs) {
}

const isUserId = function ({ dimension }) {
return USER_ID_DIMENSIONS.has(dimension)
return USER_DIMENSIONS.has(dimension)
}

const USER_ID_DIMENSIONS = new Set(['task', 'system', 'input'])

export const isSameDimension = function (combinationA, combinationB) {
return COMBINATION_DIMENSIONS.every(
({ idName }) => combinationA[idName] === combinationB[idName],
Expand Down

0 comments on commit 5f48979

Please sign in to comment.