MCPcopy Create free account
hub / github.com/violentmonkey/violentmonkey / updateScriptInfo

Function updateScriptInfo

src/background/utils/db.js:582–591  ·  view source on GitHub ↗
(id, data)

Source from the content-addressed store, hash-verified

580 * @param {DeepPartial<VMScript>} data
581 */
582export async function updateScriptInfo(id, data) {
583 const script = scriptMap[id];
584 for (const key in data) { // shallow merge
585 if (script[key]) Object.assign(script[key], data[key]);
586 }
587 await Promise.all([
588 storage.api.set({ [S_SCRIPT_PRE + id]: script }),
589 sendCmd('UpdateScript', { where: { id }, update: script }),
590 ]);
591}
592
593/**
594 * @param {string | {code:string, custom:VMScript['custom']}} src

Callers 3

_syncFunction · 0.90
MarkRemovedFunction · 0.85
UpdateScriptInfoFunction · 0.85

Calls 2

sendCmdFunction · 0.90
setMethod · 0.80

Tested by

no test coverage detected