Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Sep 12, 2021
1 parent d308dfa commit 29df3ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/combination/inputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
// task (logic) vary based on the input (data).
// Values can be any JSON type. When using objects, variations must be used
// to avoid ambiguity.
export const fromInputsObj = function (inputsObj) {
// This can be converted from/to an object and an array shape.
export const toInputsArr = function (inputsObj) {
return Object.entries(inputsObj).map(getInput)
}

Expand All @@ -19,6 +20,7 @@ const getInputPair = function ({ inputId, inputValue }) {
return { [inputId]: inputValue }
}

// Retrieve all inputs identifiers
export const getInputIds = function (inputs) {
return inputs.map(getInputId)
}
Expand Down
4 changes: 2 additions & 2 deletions src/combination/list/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { UserError } from '../../error/main.js'
import { selectCombinations } from '../../select/main.js'
import { fromInputsObj } from '../inputs.js'
import { toInputsArr } from '../inputs.js'
import { listTasks } from '../tasks/main.js'

import { validateCombinationsIds } from './validate_ids.js'
Expand All @@ -14,7 +14,7 @@ export const listCombinations = async function ({
cwd,
}) {
const tasks = await listTasks(runners, cwd)
const inputsA = fromInputsObj(inputs)
const inputsA = toInputsArr(inputs)

const combinations = getCombinationsProduct({
tasks,
Expand Down

0 comments on commit 29df3ad

Please sign in to comment.