Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cidr-tools

Package Overview
Dependencies
Maintainers
1
Versions
92
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cidr-tools - npm Package Compare versions

Comparing version 2.1.2 to 2.2.0

22

index.js

@@ -310,7 +310,21 @@ "use strict";

cidrTools.overlap = (a, b) => {
a = parse(a);
b = parse(b);
const aNets = uniq(Array.isArray(a) ? a : [a]);
const bNets = uniq(Array.isArray(b) ? b : [b]);
if (a.address.v4 !== b.address.v4) return false;
return overlap(a, b);
for (let a of aNets) {
for (let b of bNets) {
a = parse(a);
b = parse(b);
if (a.address.v4 !== b.address.v4) {
continue;
}
if (overlap(a, b)) {
return true;
}
}
}
return false;
};

2

package.json
{
"name": "cidr-tools",
"version": "2.1.2",
"version": "2.2.0",
"author": "silverwind <me@silverwind.io>",

@@ -5,0 +5,0 @@ "description": "Tools to work with IPv4 and IPv6 CIDR network lists",

@@ -49,6 +49,6 @@ # cidr-tools

- `networkA` *String*: A CIDR or IP address.
- `networkB` *String*: A CIDR or IP address.
- `networksA` *String* or *Array*: One or more CIDR or IP address.
- `networksB` *String* or *Array*: One or more CIDR or IP address.
Returns a boolean that indicates if the networks overlap (intersect) each other.
Returns a boolean that indicates if the networks A overlap (intersect) with networks B.

@@ -55,0 +55,0 @@ ### cidrTools.normalize(network)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc