Skip to content

Commit

Permalink
Chore (checkbox): Replace Boolean(find()) with native some()
Browse files Browse the repository at this point in the history
  • Loading branch information
SBoudrias committed Apr 25, 2024
1 parent 55ff070 commit 018d4d5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/checkbox/src/index.mts
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,7 @@ export default createPrompt(
setShowHelpTip(false);
setItems(items.map((choice, i) => (i === active ? toggle(choice) : choice)));
} else if (key.name === 'a') {
const selectAll = Boolean(
items.find((choice) => isSelectable(choice) && !choice.checked),
);
const selectAll = items.some((choice) => isSelectable(choice) && !choice.checked);
setItems(items.map(check(selectAll)));
} else if (key.name === 'i') {
setItems(items.map(toggle));
Expand Down

0 comments on commit 018d4d5

Please sign in to comment.