MCPcopy
hub / github.com/Effect-TS/effect / findEdges

Function findEdges

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

Source from the content-addressed store, hash-verified

690 * @category getters
691 */
692export const findEdges = <N, E, T extends Kind = "directed">(
693 graph: Graph<N, E, T> | MutableGraph<N, E, T>,
694 predicate: (data: E, source: NodeIndex, target: NodeIndex) => boolean
695): Array<EdgeIndex> => {
696 const results: Array<EdgeIndex> = []
697 for (const [edgeIndex, edgeData] of graph.edges) {
698 if (predicate(edgeData.data, edgeData.source, edgeData.target)) {
699 results.push(edgeIndex)
700 }
701 }
702 return results
703}
704
705/**
706 * Updates a single node's data by applying a transformation function.

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…