MCPcopy
hub / github.com/witheve/Eve / insert

Method insert

src/db.ts:52–61  ·  view source on GitHub ↗
(key: string, value: V)

Source from the content-addressed store, hash-verified

50interface IndexedList<V>{[v: string]: V[]}
51export class IndexList<V> extends Index<IndexedList<V>> {
52 insert(key: string, value: V) {
53 if(!this.index[key] || this.index[key].indexOf(value) === -1) {
54 if(!this.index[key]) this.index[key] = [];
55 if(!this.dirty[key]) this.dirty[key] = [];
56 this.index[key].push(value);
57 this.dirty[key].push(value);
58 return true;
59 }
60 return false;
61 }
62
63 remove(key: string, value: V) {
64 if(!this.index[key]) return false;

Callers 3

handleDiffFunction · 0.45
indexMethod · 0.45
updateDocFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected