Socket
Socket
Sign inDemoInstall

ip

Package Overview
Dependencies
0
Maintainers
3
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.3.0 to 0.3.1

10

lib/ip.js

@@ -262,3 +262,4 @@ var ip = exports,

addr.match(/^169\.254\.([0-9]{1,3})\.([0-9]{1,3})/) != null ||
addr.match(/^fc00:/) != null || addr.match(/^fe80:/) != null;
addr.match(/^fc00:/) != null || addr.match(/^fe80:/) != null ||
addr.match(/^::1$/) != null || addr.match(/^::$/) != null;
};

@@ -271,5 +272,6 @@

ip.isLoopback = function isLoopback(addr) {
return /^127\.0\.0\.1/.test(addr)
|| /^fe80::1/.test(addr)
|| /^::1/.test(addr);
return /^127\.0\.0\.1$/.test(addr)
|| /^fe80::1$/.test(addr)
|| /^::1$/.test(addr)
|| /^::$/.test(addr);
};

@@ -276,0 +278,0 @@

2

package.json
{
"name": "ip",
"version": "0.3.0",
"version": "0.3.1",
"author": "Fedor Indutny <fedor@indutny.com>",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/indutny/node-ip",

@@ -37,3 +37,3 @@ # IP

// length: 64 }
ip.cidr('192.168.1.134/26')
ip.cidrSubnet('192.168.1.134/26')
// Same as previous.

@@ -40,0 +40,0 @@

@@ -212,2 +212,8 @@ var ip = require('..'),

});
it('should check if an address is a loopback IPv6 address', function() {
assert.equal(ip.isPrivate('::'), true);
assert.equal(ip.isPrivate('::1'), true);
assert.equal(ip.isPrivate('fe80::1'), true);
});
});

@@ -259,2 +265,8 @@

});
describe('::', function () {
it('should respond with true', function () {
assert.ok(ip.isLoopback('::'))
});
});
});

@@ -261,0 +273,0 @@

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc