Comparing version 0.3.0 to 0.3.1
@@ -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 @@ |
{ | ||
"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 @@ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
22872
584
2