MCPcopy Create free account
hub / github.com/codemix/graph / getIncomingEdges

Method getIncomingEdges

packages/y-graph-storage/src/YGraphStorage.ts:197–215  ·  view source on GitHub ↗
(vertexId: ElementId)

Source from the content-addressed store, hash-verified

195 }
196
197 public *getIncomingEdges(vertexId: ElementId): Iterable<StoredEdge> {
198 const [label, uuid] = parseElementId(vertexId);
199 const collection = this.getVertexCollectionMap(label);
200 const data = collection.get(uuid);
201 if (data == null) {
202 return;
203 }
204 const incomingEdges = data.get($InEKey) as undefined | Y.Map<unknown>;
205 if (incomingEdges == null) {
206 return;
207 }
208 for (const edgeId of incomingEdges.keys() as IterableIterator<ElementId>) {
209 const edge = this.getEdgeById(edgeId);
210 if (edge == null) {
211 continue;
212 }
213 yield edge;
214 }
215 }
216
217 public *getOutgoingEdges(vertexId: ElementId): Iterable<StoredEdge> {
218 const [label, uuid] = parseElementId(vertexId);

Callers

nothing calls this directly

Calls 4

getEdgeByIdMethod · 0.95
parseElementIdFunction · 0.90
getMethod · 0.65

Tested by

no test coverage detected