(category: ChecklistCategory, bucket: ChecklistItemState[])
| 99 | } |
| 100 | const ordered: ChecklistGroup[] = []; |
| 101 | const take = (category: ChecklistCategory, bucket: ChecklistItemState[]): void => { |
| 102 | ordered.push({ |
| 103 | category, |
| 104 | items: bucket, |
| 105 | visited: bucket.filter((item) => item.visited).length, |
| 106 | confirmed: bucket.filter((item) => item.confirmed).length, |
| 107 | }); |
| 108 | }; |
| 109 | for (const category of CATEGORY_ORDER) { |
| 110 | const bucket = grouped.get(category); |
| 111 | if (bucket) { |