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

Method addVertex

packages/graph/src/GraphStorage.ts:227–232  ·  view source on GitHub ↗
(vertex: StoredVertex)

Source from the content-addressed store, hash-verified

225 }
226
227 public addVertex(vertex: StoredVertex): void {
228 if (this.#vertices.has(vertex.id)) {
229 throw new Error(`Vertex with id ${vertex.id} already exists`);
230 }
231 this.#vertices.set(vertex.id, vertex);
232 }
233
234 public deleteVertex(id: ElementId): void {
235 const vertex = this.#vertices.get(id);

Callers 1

constructorMethod · 0.95

Calls 1

hasMethod · 0.45

Tested by

no test coverage detected