| 965 | |
| 966 | /** @internal */ |
| 967 | const addNodesByIdentity = <N, E, T extends Kind, NI>( |
| 968 | mutable: MutableGraph<N, E, T>, |
| 969 | nodes: Iterable<readonly [NI, N]> |
| 970 | ): MutableHashMap.MutableHashMap<NI, NodeIndex> => { |
| 971 | const indexByIdentity = MutableHashMap.empty<NI, NodeIndex>() |
| 972 | for (const [identity, data] of nodes) { |
| 973 | MutableHashMap.set(indexByIdentity, identity, addNode(mutable, data)) |
| 974 | } |
| 975 | return indexByIdentity |
| 976 | } |
| 977 | |
| 978 | /** @internal */ |
| 979 | const addEdgeByIdentity = <N, E, T extends Kind, NI, EI>( |