MCPcopy Create free account
hub / github.com/EsperoTech/yaade / patchScriptData

Function patchScriptData

client/src/state/collections.tsx:473–485  ·  view source on GitHub ↗
(state: Collection[], id: number, data: any)

Source from the content-addressed store, hash-verified

471}
472
473function patchScriptData(state: Collection[], id: number, data: any): Collection[] {
474 const oldScript = findScript(state, id);
475 if (!oldScript) return state;
476 return modifyCollection(state, oldScript.collectionId, (c) => {
477 if (!c.scripts) return;
478 for (const script of c.scripts) {
479 if (script.id === id) {
480 script.data = { ...script.data, ...data };
481 return;
482 }
483 }
484 });
485}
486
487function changeScriptOwner(
488 state: Collection[],

Callers 1

collectionsReducerFunction · 0.85

Calls 2

findScriptFunction · 0.85
modifyCollectionFunction · 0.85

Tested by

no test coverage detected