(before, after)
| 204 | } |
| 205 | |
| 206 | function compareManifests(before, after) { |
| 207 | const oldById = new Map(before.map((item) => [item.leetcodeId, item])); |
| 208 | const newById = new Map(after.map((item) => [item.leetcodeId, item])); |
| 209 | const added = after.filter((item) => !oldById.has(item.leetcodeId)); |
| 210 | const removed = before.filter((item) => !newById.has(item.leetcodeId)); |
| 211 | const changed = after.filter((item) => oldById.has(item.leetcodeId) && !sameItem(oldById.get(item.leetcodeId), item)); |
| 212 | return { added, removed, changed }; |
| 213 | } |
| 214 | |
| 215 | function itemLabel(item) { |
| 216 | return `#${item.leetcodeId} ${item.titleZh} (${item.slug})`; |
no test coverage detected