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 29df3ad commit 77d8a19
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/combination/inputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@
// Values can be any JSON type. When using objects, variations must be used
// to avoid ambiguity.
// This can be converted from/to an object and an array shape.
export const toInputsArr = function (inputsObj) {
return Object.entries(inputsObj).map(getInput)
export const toInputsArr = function (inputs) {
return Object.entries(inputs).map(getInput)
}

const getInput = function ([inputId, inputValue]) {
return { inputId, inputValue }
}

export const toInputsObj = function (inputs) {
return Object.assign({}, ...inputs.map(getInputPair))
export const toInputsObj = function (inputsArr) {
return Object.assign({}, ...inputsArr.map(getInputPair))
}

const getInputPair = function ({ inputId, inputValue }) {
return { [inputId]: inputValue }
}

// Retrieve all inputs identifiers
export const getInputIds = function (inputs) {
return inputs.map(getInputId)
export const getInputIds = function (inputsArr) {
return inputsArr.map(getInputId)
}

const getInputId = function ({ inputId }) {
Expand Down

0 comments on commit 77d8a19

Please sign in to comment.