How to use native-url - 2 common examples

To help you get started, we’ve selected a few native-url examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github creatorsdaily / client.creatorsdaily.com / components / Autofill.js View on Github external
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
  }
}
github creatorsdaily / client.creatorsdaily.com / components / ProductLinks.js View on Github external
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'

native-url

Brings the node url api layer to whatwg-url class

Apache-2.0
Latest version published 4 years ago

Package Health Score

71 / 100
Full package analysis

Popular native-url functions