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

Function cloneAdjacency

packages/effect/src/Graph.ts:232–238  ·  view source on GitHub ↗
(adjacency: Map<NodeIndex, Array<EdgeIndex>>)

Source from the content-addressed store, hash-verified

230
231/** @internal */
232const cloneAdjacency = (adjacency: Map<NodeIndex, Array<EdgeIndex>>): Map<NodeIndex, Array<EdgeIndex>> => {
233 const cloned = new Map<NodeIndex, Array<EdgeIndex>>()
234 for (const [nodeIndex, edges] of adjacency) {
235 cloned.set(nodeIndex, [...edges])
236 }
237 return cloned
238}
239
240/**
241 * Immutable graph type for source-to-target relationships.

Callers 2

beginMutationFunction · 0.85
endMutationFunction · 0.85

Calls 1

setMethod · 0.65

Tested by

no test coverage detected