How to use the is-cidr.v6 function in is-cidr

To help you get started, we’ve selected a few is-cidr 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 graalvm / graaljs / deps / npm / lib / token.js View on Github external
function validateCIDR (cidr) {
  if (isCidrV6(cidr)) {
    throw new Error('CIDR whitelist can only contain IPv4 addresses, ' + cidr + ' is IPv6')
  if (!isCidrV4(cidr)) {
    throw new Error('CIDR whitelist contains invalid CIDR entry: ' + cidr)


Check if a string is an IP address in CIDR notation

Latest version published 12 days ago

Package Health Score

72 / 100
Full package analysis

Similar packages