replace Array.from with a splat or whatever it's called

This commit is contained in:
rhiannon morris 2024-07-07 20:11:45 +02:00
parent b1b0f806d5
commit 97660781a7

View file

@ -11,7 +11,7 @@ let showSingles = false;
function fillSets(): [Set<string>, Set<string>] { function fillSets(): [Set<string>, Set<string>] {
function checkedValues(boxes: Boxes) { function checkedValues(boxes: Boxes) {
return new Set(Array.from(boxes).filter(b => b.checked).map(b => b.value)); return new Set([...boxes].filter(b => b.checked).map(b => b.value));
} }
return [checkedValues(reqBoxes), checkedValues(excBoxes)]; return [checkedValues(reqBoxes), checkedValues(excBoxes)];
@ -38,7 +38,7 @@ function updateItems() {
} }
function disp(pfx: string, tags: string[]) { function disp(pfx: string, tags: string[]) {
return Array(...tags).map(x => pfx + x).join('\u2003'); // em space return [...tags].map(x => pfx + x).join('\u2003'); // em space
} }
let plus = disp('+\u2009', Array.from(reqTags)); // thin space let plus = disp('+\u2009', Array.from(reqTags)); // thin space
let minus = disp('-\u2009', Array.from(excTags)); let minus = disp('-\u2009', Array.from(excTags));