Comparing version 0.0.6 to 0.0.7
@@ -7,3 +7,3 @@ /* | ||
var proto = { | ||
version: '0.0.6', | ||
version: '0.0.7', | ||
Auto: function (ip, subnet, prefix) { | ||
@@ -84,4 +84,6 @@ if (!ip || !subnet) { | ||
}, | ||
Filter: function (ip, subnets) { | ||
this.setSubnets(subnets); | ||
Filter: function (ip, subnets, noupdate) { | ||
if (!('subnets' in this) || !noupdate) { | ||
this.setSubnets(subnets); | ||
}; | ||
if (Array.isArray(ip)){ | ||
@@ -95,4 +97,6 @@ return ip.filter(function(ip) { | ||
}, | ||
Validate: function (ip, subnets) { | ||
this.setSubnets(subnets); | ||
Validate: function (ip, subnets, noupdate) { | ||
if (!('subnets' in this) || !noupdate) { | ||
this.setSubnets(subnets); | ||
}; | ||
if (Array.isArray(ip)){ | ||
@@ -99,0 +103,0 @@ return ip.map(function(ip) { |
{ | ||
"name": "insubnet", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"homepage": "http://louist.github.io/inSubnet/", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -1,2 +0,2 @@ | ||
inSubnet (v0.0.6) | ||
inSubnet (v0.0.7) | ||
====== | ||
@@ -58,13 +58,18 @@ | ||
inSubnet.Validate(ip[, subnets]) - Check <ip> or an Array of IPs against an array of subnets set by "setSubnets()". | ||
If <subnets> is passed, uses "setSubnets()". - Returns boolean or an Array of boolean. | ||
inSubnet.Validate(ip[, subnets[, no update]]) - Check <ip> or an Array of IPs against an array of subnets set by "setSubnets()". | ||
If <subnets> is passed, uses "setSubnets()". If <no update> is true, do not call "setSubnets()". | ||
Returns boolean or an Array of boolean. | ||
Examples: inSubnet.Validate('127.0.0.1',['127.0.0.1/32','adf::1/32']); // true | ||
inSubnet.Validate(['127.0.0.1','127.0.0.2'],['127.0.0.1/32']); // [true,false] | ||
inSubnet.Validate(['127.0.0.1','127.0.0.2','adf::1'],['127.0.0.1/32'],true); // [true,false,true] - Uses previously set subnets. | ||
inSubnet.Validate(['127.0.0.1','127.0.0.2','adf::1'],['127.0.0.1/32']); // [true,false,false] - Overwrite previously set subnets. | ||
inSubnet.Filter(array[, subnets]) - Filter an Array of IP addresses against subnets set with "setSubnets()". | ||
If <subnets> is passed, uses "setSubnets()". - Returns IP or false, Array of valid IPs. | ||
inSubnet.Filter(array[, subnets[, no update]]) - Filter an Array of IP addresses against subnets set with "setSubnets()". | ||
If <subnets> is passed, uses "setSubnets()". If <no update> is true, do not call "setSubnets()". | ||
Returns IP or false, Array of valid IPs. | ||
Examples: inSubnet.Filter(['127.0.0.1','adf::1','127.0.0.2'],['127.0.0.1/32','adf::1/32']); // ['127.0.0.1','adf::1'] | ||
inSubnet.Filter('127.0.0.1',['127.0.0.1/32','adf::1/32']); // 127.0.0.1 | ||
inSubnet.Filter('adf::1',['127.0.0.1/32'],true); // true - Uses previously set subnets. | ||
inSubnet.Filter('adf::1',['127.0.0.1/32']); // false - Overwrite previously set subnets. | ||
inSubnet.Filter('127.0.0.2',['127.0.0.1/32','adf::1/32']); // false | ||
@@ -82,3 +87,3 @@ | ||
inSubnet.setSubnets(subnets) - Set a list of subnets for "Validate()". | ||
inSubnet.setSubnets(subnets) - Set a list of subnets for "Validate()" and "Filter()". | ||
WARNING: Overrides all previous "setSubnets()" calls. - Returns boolean. | ||
@@ -85,0 +90,0 @@ |
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
29998
494
106