(items)
| 200 | } |
| 201 | |
| 202 | function countBy(items) { |
| 203 | return items.reduce((map, item) => { |
| 204 | map.set(item, (map.get(item) ?? 0) + 1) |
| 205 | return map |
| 206 | }, new Map()) |
| 207 | } |
| 208 | |
| 209 | // Bag diff: any summary appearing more in one bag than the other becomes added/removed. |
| 210 | function diffSummaries(prev, curr) { |
no test coverage detected