| 977 | |
| 978 | /** @internal */ |
| 979 | const addEdgeByIdentity = <N, E, T extends Kind, NI, EI>( |
| 980 | mutable: MutableGraph<N, E, T>, |
| 981 | indexByIdentity: MutableHashMap.MutableHashMap<NI, NodeIndex>, |
| 982 | identity: EdgeIdentity<NI, EI>, |
| 983 | data: E |
| 984 | ): void => { |
| 985 | const sourceIndex = Option.getOrUndefined(MutableHashMap.get(indexByIdentity, identity.source)) |
| 986 | const targetIndex = Option.getOrUndefined(MutableHashMap.get(indexByIdentity, identity.target)) |
| 987 | if (sourceIndex !== undefined && targetIndex !== undefined) { |
| 988 | addEdge(mutable, sourceIndex, targetIndex, data) |
| 989 | } |
| 990 | } |
| 991 | |
| 992 | /** @internal */ |
| 993 | const assertSameKind = <N, E>(self: Graph<N, E, Kind>, that: Graph<N, E, Kind>): void => { |