MCPcopy Index your code
hub / github.com/hoothin/UserScripts / getListData

Function getListData

Pagetual/pagetual.user.js:4475–4491  ·  view source on GitHub ↗
(list, key)

Source from the content-addressed store, hash-verified

4473 });
4474 }
4475 async function getListData(list, key) {
4476 return new Promise((resolve) => {
4477 storage.getItem(list, listData => {
4478 let value;
4479 if (listData) {
4480 for(var i = 0; i < listData.length; i++) {
4481 let data = listData[i];
4482 if (data.k === key) {
4483 value = data.v;
4484 break;
4485 }
4486 }
4487 }
4488 resolve(value);
4489 });
4490 });
4491 }
4492 function setListData(list, key, value, length) {
4493 storage.getItem(list, listData => {
4494 if (!listData) {

Callers 1

initRulesFunction · 0.85

Calls 1

resolveFunction · 0.50

Tested by

no test coverage detected