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

Method _storeObject

src/runtime/changes.ts:282–296  ·  view source on GitHub ↗
(operation: "store" | "unstore", id: string, object: any, node: string, scope: string)

Source from the content-addressed store, hash-verified

280 }
281
282 _storeObject(operation: "store" | "unstore", id: string, object: any, node: string, scope: string) {
283 for(let attr of Object.keys(object)) {
284 let value = object[attr];
285 if(value === undefined) continue;
286 if(value.constructor === Array) {
287 for(let item of value) {
288 this[operation](scope, id, attr, item, node);
289 }
290 } else if(typeof value === "object") {
291 throw new Error("Attempting to store a non-value in an Eve database");
292 } else {
293 this[operation](scope, id, attr, value, node);
294 }
295 }
296 }
297
298 storeObject(id: string, object: any, node: string, scope: string) {
299 this._storeObject("store", id, object, node, scope);

Callers 2

storeObjectMethod · 0.95
unstoreObjectMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected