Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const urlRank = x => {
const { host } = url.parse(x)
switch (host) {
case 'apps.apple.com':
return 99
case 'itunes.apple.com':
return 98
case 'play.google.com':
return 89
default:
return 1
}
}
const list = links.map(x => {
const { host } = url.parse(x)
let name = '网址'
let icon = 'compass'
if (host === 'apps.apple.com' || host === 'itunes.apple.com') {
name = 'AppStore'
icon = 'apple'
}
if (host === 'github.com') {
name = 'GitHub'
icon = 'github'
}
if (host === 'www.coolapk.com') {
name = '酷安'
icon = 'android'
}
if (host === 'play.google.com') {
name = 'Google Play'