()
| 8676 | const nodeIterator = nodeMap.entries() |
| 8677 | |
| 8678 | const nextMapped = () => { |
| 8679 | let current = nodeIterator.next() |
| 8680 | while (!current.done) { |
| 8681 | const [nodeIndex, nodeData] = current.value |
| 8682 | const adjacencyList = adjacencyMap.get(nodeIndex) |
| 8683 | |
| 8684 | // Node is external if it has no edges in the specified direction |
| 8685 | if (adjacencyList === undefined || adjacencyList.length === 0) { |
| 8686 | return { done: false, value: withMutationGuard(graph, () => f(nodeIndex, nodeData)) } |
| 8687 | } |
| 8688 | current = nodeIterator.next() |
| 8689 | } |
| 8690 | |
| 8691 | return { done: true, value: undefined } as const |
| 8692 | } |
| 8693 | |
| 8694 | return { next: nextMapped } |
| 8695 | } |
nothing calls this directly
no test coverage detected