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

Function remove

src/background/utils/storage-cache.js:107–128  ·  view source on GitHub ↗
(keys)

Source from the content-addressed store, hash-verified

105 },
106
107 async remove(keys) {
108 const toDelete = keys.filter(key => {
109 let ok = dbKeys.get(key) !== 0;
110 if (ok) {
111 cache.del(key);
112 dbKeys.set(key, 0);
113 if (undoing) return ok;
114 if (storage[S_VALUE].toId(key)) {
115 valuesToFlush[key] = null;
116 ok = false;
117 } else {
118 if (key.startsWith(S_SCRIPT_PRE)) updateScriptMap(key);
119 updateScriptSizeContributor(key);
120 }
121 }
122 return ok;
123 });
124 if (toDelete.length) await api.remove(toDelete);
125 if (undoing) return;
126 if (keys.length) fire(keys);
127 flushLater();
128 },
129};
130
131setInterval(() => {

Callers

nothing calls this directly

Calls 9

updateScriptMapFunction · 0.90
flushLaterFunction · 0.85
filterMethod · 0.80
setMethod · 0.80
toIdMethod · 0.80
removeMethod · 0.80
fireFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected