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

Method getMulti

src/background/utils/storage.js:41–47  ·  view source on GitHub ↗

* @param {?string[]} [ids] - if null/absent, the entire storage is returned * @param {function(val:?,key:string):?} [transform] * @return {Promise<?>} - single value or object of id:value

(ids, transform)

Source from the content-addressed store, hash-verified

39 * @return {Promise<?>} - single value or object of id:value
40 */
41 async getMulti(ids, transform) {
42 const keys = ids?.map(this.toKey, this);
43 const data = await api.get(keys);
44 return transform || this.prefix
45 ? data::mapEntry(transform, this.toId, this)
46 : data;
47 }
48
49 /**
50 * @param {string|number|Array<string|number>} id

Callers 3

ExportZipFunction · 0.80
getIconCacheFunction · 0.80
addValueOpenerFunction · 0.80

Calls 3

mapEntryFunction · 0.90
mapMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected