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

Function removeEdge

packages/effect/src/Graph.ts:2428–2442  ·  view source on GitHub ↗
(
  mutable: MutableGraph<N, E, T>,
  edgeIndex: EdgeIndex
)

Source from the content-addressed store, hash-verified

2426 * @since 3.18.0
2427 */
2428export const removeEdge = <N, E, T extends Kind = "directed">(
2429 mutable: MutableGraph<N, E, T>,
2430 edgeIndex: EdgeIndex
2431): void => {
2432 assertMutable(mutable)
2433 const impl = graphImpl(mutable)
2434
2435 const wasRemoved = removeEdgeInternal(impl, edgeIndex)
2436
2437 // Only invalidate cycle flag if an edge was actually removed
2438 // and only if the graph wasn't already known to be acyclic
2439 if (wasRemoved) {
2440 invalidateCycleFlagOnRemoval(impl)
2441 }
2442}
2443
2444/** @internal */
2445const removeEdgeInternal = <N, E, T extends Kind = "directed">(

Callers 2

filterMapEdgesFunction · 0.85
filterEdgesFunction · 0.85

Calls 4

assertMutableFunction · 0.85
graphImplFunction · 0.85
removeEdgeInternalFunction · 0.85

Tested by

no test coverage detected