MCPcopy Create free account
hub / github.com/Effect-TS/effect / nextMapped

Function nextMapped

packages/effect/src/Graph.ts:8678–8692  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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 }

Callers

nothing calls this directly

Calls 4

withMutationGuardFunction · 0.85
nextMethod · 0.65
getMethod · 0.65
fFunction · 0.50

Tested by

no test coverage detected