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

Method remove

packages/graph/src/indexes/HashIndex.ts:46–61  ·  view source on GitHub ↗
(elementId: ElementId, _value: unknown)

Source from the content-addressed store, hash-verified

44 }
45
46 public remove(elementId: ElementId, _value: unknown): void {
47 // Use stored value from reverse index to ensure we remove correctly
48 const storedValue = this.#reverse.get(elementId);
49 if (storedValue === undefined) {
50 return;
51 }
52
53 const ids = this.#index.get(storedValue);
54 if (ids) {
55 ids.delete(elementId);
56 if (ids.size === 0) {
57 this.#index.delete(storedValue);
58 }
59 }
60 this.#reverse.delete(elementId);
61 }
62
63 public update(elementId: ElementId, oldValue: unknown, newValue: unknown): void {
64 this.remove(elementId, oldValue);

Callers 1

updateMethod · 0.95

Calls 1

getMethod · 0.65

Tested by

no test coverage detected