🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

is-cidr

Package Overview
Dependencies
Maintainers
2
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-cidr - npm Package Compare versions

Comparing version

to
4.0.2

17

index.js
"use strict";
const cidrRegex = require("cidr-regex");
const {v4, v6} = require("cidr-regex");
const re4 = cidrRegex.v4({exact: true});
const re6 = cidrRegex.v6({exact: true});
const re4 = v4({exact: true});
const re6 = v6({exact: true});
const isCidr = module.exports = str => {
if (re4.test(str)) return 4;
if (re6.test(str)) return 6;
return 0;
};
isCidr.v4 = str => re4.test(str);
isCidr.v6 = str => re6.test(str);
module.exports = str => re4.test(str) ? 4 : (re6.test(str) ? 6 : 0);
module.exports.v4 = str => re4.test(str);
module.exports.v6 = str => re6.test(str);
{
"name": "is-cidr",
"version": "4.0.1",
"version": "4.0.2",
"description": "Check if a string is an IP address in CIDR notation",

@@ -33,9 +33,9 @@ "author": "silverwind <me@silverwind.io>",

"dependencies": {
"cidr-regex": "^3.1.0"
"cidr-regex": "^3.1.1"
},
"devDependencies": {
"eslint": "7.8.1",
"eslint-config-silverwind": "18.0.8",
"eslint": "7.10.0",
"eslint-config-silverwind": "18.0.10",
"jest": "26.4.2",
"updates": "10.3.6",
"updates": "11.1.5",
"versions": "8.4.3"

@@ -42,0 +42,0 @@ },