( graph: Graph<N, E, T> | MutableGraph<N, E, T> )
| 5708 | * @since 3.18.0 |
| 5709 | */ |
| 5710 | export const edges = <N, E, T extends Kind = "directed">( |
| 5711 | graph: Graph<N, E, T> | MutableGraph<N, E, T> |
| 5712 | ): EdgeWalker<E> => |
| 5713 | new Walker((f) => ({ |
| 5714 | [Symbol.iterator]() { |
| 5715 | const edgeMap = graphImpl(graph).edges |
| 5716 | const iterator = edgeMap.entries() |
| 5717 | |
| 5718 | return { |
| 5719 | next() { |
| 5720 | const result = iterator.next() |
| 5721 | if (result.done) { |
| 5722 | return { done: true, value: undefined } |
| 5723 | } |
| 5724 | const [edgeIndex, edgeData] = result.value |
| 5725 | return { done: false, value: f(edgeIndex, edgeData) } |
| 5726 | } |
| 5727 | } |
| 5728 | } |
| 5729 | })) |
| 5730 | |
| 5731 | /** |
| 5732 | * Configuration for selecting external nodes. |
nothing calls this directly
no outgoing calls
no test coverage detected