( graph: Graph<N, E, T> | MutableGraph<N, E, T>, makeIterator: <U>(cache: csr.Csr, f: (index: NodeIndex, data: N) => U) => Iterator<U> )
| 7645 | } |
| 7646 | |
| 7647 | const makeCsrNodeWalker = <N, E, T extends Kind>( |
| 7648 | graph: Graph<N, E, T> | MutableGraph<N, E, T>, |
| 7649 | makeIterator: <U>(cache: csr.Csr, f: (index: NodeIndex, data: N) => U) => Iterator<U> |
| 7650 | ): Walker<NodeIndex, N> => { |
| 7651 | return new Walker((f) => ({ |
| 7652 | // Capture CSR at iterator creation so invalidation cannot change an in-flight mutable traversal. |
| 7653 | [Symbol.iterator]: () => |
| 7654 | makeIterator(csr.get(graph), (index, data) => withMutationGuard(graph, () => f(index, data))) |
| 7655 | })) |
| 7656 | } |
| 7657 | |
| 7658 | const traversalStarts = <N, E, T extends Kind>( |
| 7659 | graph: Graph<N, E, T> | MutableGraph<N, E, T>, |
no test coverage detected