( nodes: readonly NodeIdentity[], key: (n: NodeIdentity) => string )
| 1801 | ]; |
| 1802 | |
| 1803 | function groupNodeIdentities( |
| 1804 | nodes: readonly NodeIdentity[], |
| 1805 | key: (n: NodeIdentity) => string |
| 1806 | ): Map<string, NodeIdentity[]> { |
| 1807 | const groups = new Map<string, NodeIdentity[]>(); |
| 1808 | for (const n of nodes) { |
| 1809 | const k = key(n); |
| 1810 | const group = groups.get(k); |
| 1811 | if (group) group.push(n); |
| 1812 | else groups.set(k, [n]); |
| 1813 | } |
| 1814 | return groups; |
| 1815 | } |
| 1816 | |
| 1817 | /** |
| 1818 | * Pair each node a file had before a re-index with the node that replaces it, |
no test coverage detected