How to use the is-ip.v4 function in is-ip

To help you get started, we’ve selected a few is-ip 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 samuelmaddock / metastream / app / renderer / platform / swarm / ws-client-coordinator.ts View on Github external
const formatDestAddress = (ip: string) => {
  const hasPort = !isNaN(ip.split(':').pop() || ('' as any))
  if (isIp.v4(ip) && hasPort) {
    return ip
  }
  return urlFormat({ hostname: ip, port: WEBSOCKET_PORT_DEFAULT })
}
github berty / berty / client / react-native / tools / dashboard / node-geoip / lib / geoip.js View on Github external
function isIP (string) {
  if (isIpLib.v4(string)) return 4
  else if (isIpLib.v6(string)) return 6
  else return 0
}

is-ip

Check if a string is an IP address

MIT
Latest version published 9 months ago

Package Health Score

71 / 100
Full package analysis

Popular is-ip functions