How to use the range_check.validRange function in range_check

To help you get started, we’ve selected a few range_check 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 casz / express-ipfilter / lib / ipfilter.js View on Github external
const testIp = function(ip, mode) {
    const constraint = this

    // Check if it is an array or a string
    if (typeof constraint === 'string') {
      if (rangeCheck.validRange(constraint)) {
        return testCidrBlock(ip, constraint, mode)
      } else {
        return testExplicitIp(ip, constraint, mode)
      }
    }

    if (typeof constraint === 'object') {
      return testRange(ip, constraint, mode)
    }
  }
github keystonejs / keystone-classic / lib / security / ipRangeRestrict.js View on Github external
allowedRanges = _.filter(allowedRanges, function (ipRange) {
			return range_check.validRange(ipRange);
		});

range_check

This is a simple module to validate IP address, check ip address version, check if ip is within a range.

BSD-2-Clause
Latest version published 3 years ago

Package Health Score

50 / 100
Full package analysis