MCPcopy Index your code
hub / github.com/violentmonkey/violentmonkey / get

Function get

src/common/cache.js:28–34  ·  view source on GitHub ↗
(key, def, shouldHit = true)

Source from the content-addressed store, hash-verified

26 batchStartTime = 0;
27 }
28 function get(key, def, shouldHit = true) {
29 const item = cache[key];
30 if (item && shouldHit) {
31 reschedule(item, item.lifetime);
32 }
33 return item ? item.value : def;
34 }
35 /**
36 * @param {(val:?, key:string) => void} fn
37 * @param {Object} [thisObj]

Callers 1

popFunction · 0.70

Calls 1

rescheduleFunction · 0.85

Tested by

no test coverage detected