Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
alignments
Browse files Browse the repository at this point in the history
  • Loading branch information
bdavidxyz committed Jan 4, 2017
1 parent 4bcda09 commit a4d5c68
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions live/app/utils/labeled-checkboxes.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ export default function labeledCheckboxes (proposals, userAnswers) {
if (_(definedUserAnswers).size() > _(proposals).size()) return [];

const sizeDifference = _(proposals).size() - _(definedUserAnswers).size(); // 2
const arrayOfFalse = _.times(sizeDifference, _.constant(false)); // [false, false]
const arrayOfFalse = _.times(sizeDifference, _.constant(false)); // [false, false]

return _.chain(definedUserAnswers) // [false, true]
.concat(arrayOfFalse) // [false, true, false, false]
.zip(proposals) // [[false, 'prop 1'], [true, 'prop 2'], [false, 'prop 3'], [false, 'prop 4']]
.map(_.reverse) // [['prop 1', false], ['prop 2', true], ['prop 3', false], ['prop 4', false]]
return _.chain(definedUserAnswers) // [false, true]
.concat(arrayOfFalse) // [false, true, false, false]
.zip(proposals) // [[false, 'prop 1'], [true, 'prop 2'], [false, 'prop 3'], [false, 'prop 4']]
.map(_.reverse) // [['prop 1', false], ['prop 2', true], ['prop 3', false], ['prop 4', false]]
.value();

}

0 comments on commit a4d5c68

Please sign in to comment.