Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const start = parseInt(req.query.start || '0');
if (start - num >= 0) {
req.query.start = start - num;
apps.prev = buildUrl(req, '/apps/') + '?' + qs.stringify(req.query);
}
if (start + num <= 500) {
req.query.start = start + num;
apps.next = buildUrl(req, '/apps/') + '?' + qs.stringify(req.query);
}
return apps;
}
gplay.list(req.query)
.then((apps) => apps.map(cleanUrls(req)))
.then(toList).then(paginate)
.then(res.json.bind(res))
.catch(next);
});