(a: readonly T[], b: readonly T[])
| 93 | } |
| 94 | |
| 95 | function merge<T extends { id: string }>(a: readonly T[], b: readonly T[]) { |
| 96 | const items = new Map(a.map((item) => [item.id, item] as const)) |
| 97 | for (const item of b) items.set(item.id, item) |
| 98 | return [...items.values()].sort((x, y) => cmp(x.id, y.id)) |
| 99 | } |
| 100 | |
| 101 | function reconcileFetched<T extends { id: string }>( |
| 102 | fetched: T[], |
no test coverage detected