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

Function addNodesByIdentity

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

Source from the content-addressed store, hash-verified

965
966/** @internal */
967const addNodesByIdentity = <N, E, T extends Kind, NI>(
968 mutable: MutableGraph<N, E, T>,
969 nodes: Iterable<readonly [NI, N]>
970): MutableHashMap.MutableHashMap<NI, NodeIndex> => {
971 const indexByIdentity = MutableHashMap.empty<NI, NodeIndex>()
972 for (const [identity, data] of nodes) {
973 MutableHashMap.set(indexByIdentity, identity, addNode(mutable, data))
974 }
975 return indexByIdentity
976}
977
978/** @internal */
979const 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