Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function handler ({ topic, id }: PathArgs) {
const meta = await webstore.detail({ id })
switch (topic) {
case 'v':
return {
subject: 'chrome web store',
status: version(meta.version),
color: versionColor(meta.version)
}
case 'users':
return {
subject: 'users',
status: millify(parseInt(meta.users.replace(/,/g, ''))),
color: 'green'
}
case 'price':
return {
subject: 'price',