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

Function addNodesByIdentity

packages/effect/src/Graph.ts:828–837  ·  view source on GitHub ↗
(
  mutable: MutableGraph<N, E, T>,
  nodes: Iterable<readonly [NI, N]>
)

Source from the content-addressed store, hash-verified

826
827/** @internal */
828const addNodesByIdentity = <N, E, T extends Kind, NI>(
829 mutable: MutableGraph<N, E, T>,
830 nodes: Iterable<readonly [NI, N]>
831): MutableHashMap.MutableHashMap<NI, NodeIndex> => {
832 const indexByIdentity = MutableHashMap.empty<NI, NodeIndex>()
833 for (const [identity, data] of nodes) {
834 MutableHashMap.set(indexByIdentity, identity, addNode(mutable, data))
835 }
836 return indexByIdentity
837}
838
839/** @internal */
840const addEdgeByIdentity = <N, E, T extends Kind, NI, EI>(

Callers 1

Graph.tsFile · 0.85

Calls 2

addNodeFunction · 0.85
setMethod · 0.65

Tested by

no test coverage detected