Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
callback(err);
}
});
break;
case 'object':
// DB object was provided
// determine size of DB
// by iterating over all key/value pairs
// filtering for this DB
// we want to measure all persisted collections of a DB
// independent of whether they're attached to the DB
// at runtime via db.collection(name)
localforage.iterate(function (value, key) {
if ((key.lastIndexOf(target.name(), 0) === 0) && value !== null) {
_mapSizeCb(value, key);
}
}).then(function () {
// done - report back
callback(null, resultMap);
}).catch(function (err) {
console.error(JSON.stringify(err));
if (callback) {
callback(err);
}
});
break;
default:
if (callback) {
function* fetchS2E() {
try {
const resultList: any[] = [];
const result = yield localforage.iterate((value: any, key, iterationNumber) => {
if (value.type === 'S2E') {
resultList.push(value);
}
});
// console.log(resultList);
yield put({ type: issuerActions.SET_S2E_APPROVAL_LIST, payload: resultList });
return resultList;
} catch (err) {
throw err;
}
}
function* fetchE2S() {
try {
const resultList: any[] = [];
// const res = yield axios.get(
// `${HORIZON}/accounts/${STELLAR_USER}/payments?limit=10&order=desc`);
// res.data._embedded.records.forEach((item) => {
// resultList.push(item);
// });
const result = yield localforage.iterate((value: any, key, iterationNumber) => {
if (value.type === 'E2S') {
resultList.push(value);
}
});
yield put({ type: issuerActions.SET_E2S_APPROVAL_LIST, payload: resultList });
return resultList;
} catch (err) {
throw err;
}
}
function* fetchS2E() {
.then(() =>
localForage
.iterate((entity, key) => {
const [entityType, entityId] = key.split('.');
entities[entityType] = entities[entityType] || {};
entities[entityType][entityId] = entity;
})
.then(() => resolve(entities)),
);