cidr-tools
Advanced tools
Comparing version 2.0.1 to 2.0.2
12
index.js
@@ -45,2 +45,6 @@ "use strict"; | ||
function uniq(arr) { | ||
return [...new Set(arr)]; | ||
} | ||
function overlap(a, b) { | ||
@@ -225,3 +229,3 @@ const aStart = a.start({type: "bigInteger"}); | ||
cidrTools.merge = function(nets) { | ||
nets = (Array.isArray(nets) ? nets : [nets]).map(parse); | ||
nets = uniq((Array.isArray(nets) ? nets : [nets]).map(parse)); | ||
const maps = mapNets(nets); | ||
@@ -270,4 +274,4 @@ | ||
cidrTools.exclude = function(basenets, exclnets) { | ||
basenets = Array.isArray(basenets) ? basenets : [basenets]; | ||
exclnets = Array.isArray(exclnets) ? exclnets : [exclnets]; | ||
basenets = uniq(Array.isArray(basenets) ? basenets : [basenets]); | ||
exclnets = uniq(Array.isArray(exclnets) ? exclnets : [exclnets]); | ||
@@ -304,3 +308,3 @@ basenets = cidrTools.merge(basenets); | ||
cidrTools.expand = function(nets) { | ||
nets = Array.isArray(nets) ? nets : [nets]; | ||
nets = uniq(Array.isArray(nets) ? nets : [nets]); | ||
@@ -307,0 +311,0 @@ let ips = []; |
{ | ||
"name": "cidr-tools", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"author": "silverwind <me@silverwind.io>", | ||
@@ -5,0 +5,0 @@ "description": "Tools to work with IPv4 and IPv6 CIDR network lists", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12266
264