MCPcopy Index your code
hub / github.com/Effect-TS/effect / findNodes

Function findNodes

packages/effect/src/Graph.ts:616–627  ·  view source on GitHub ↗
(
  graph: Graph<N, E, T> | MutableGraph<N, E, T>,
  predicate: (data: N) => boolean
)

Source from the content-addressed store, hash-verified

614 * @category getters
615 */
616export const findNodes = <N, E, T extends Kind = "directed">(
617 graph: Graph<N, E, T> | MutableGraph<N, E, T>,
618 predicate: (data: N) => boolean
619): Array<NodeIndex> => {
620 const results: Array<NodeIndex> = []
621 for (const [index, data] of graph.nodes) {
622 if (predicate(data)) {
623 results.push(index)
624 }
625 }
626 return results
627}
628
629/**
630 * Finds the first edge that matches the given predicate.

Callers

nothing calls this directly

Calls 1

predicateFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…