( graph: Graph<N, E, "directed"> | MutableGraph<N, E, "directed">, nodeIndex: NodeIndex, direction: Direction )
| 1753 | const impl = graphImpl(graph) |
| 1754 | const results: Array<EdgeIndex> = [] |
| 1755 | for (const [edgeIndex, edgeData] of impl.edges) { |
| 1756 | if (predicate(edgeData.data, edgeData.source, edgeData.target)) { |
| 1757 | results.push(edgeIndex) |
| 1758 | } |
| 1759 | } |
| 1760 | return results |
| 1761 | }) |
| 1762 | |
| 1763 | /** |
| 1764 | * Updates a single node's data by applying a transformation function. |
| 1765 | * |
| 1766 | * **Example** (Updating node data) |
| 1767 | * |
| 1768 | * ```ts import.meta.vitest |
| 1769 | * import { Graph, Option } from "effect" |
| 1770 | * |
| 1771 | * const graph = Graph.directed<string, number>((mutable) => { |
| 1772 | * Graph.addNode(mutable, "Node A") |
| 1773 | * Graph.addNode(mutable, "Node B") |
| 1774 | * Graph.updateNode(mutable, 0, (data) => data.toUpperCase()) |
| 1775 | * }) |
| 1776 | * |
| 1777 | * Graph.getNode(graph, 0) // => Option.some("NODE A") |
| 1778 | * ``` |
| 1779 | * |
| 1780 | * @category transforming |
| 1781 | * @since 3.18.0 |
no test coverage detected
searching dependent graphs…