Merge pull request #11618 from MoLow/master

add contains function
This commit is contained in:
Vladimir Matveev
2016-09-29 13:11:03 -07:00
committed by GitHub
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -19,3 +19,4 @@ var buff:any = ip.toBuffer(myIP);
ip.toString(buff);
ip.subnet('192.168.1.134', '255.255.255.192');
ip.cidrSubnet('192.168.1.134/26');
ip.cidrSubnet('192.168.1.134/26').contains('192.168.1.134');
Vendored
+2 -1
View File
@@ -14,6 +14,7 @@ interface SubnetInfo {
subnetMaskLength: number;
numHosts: number;
length: number;
contains(ip: string): boolean;
}
declare module "ip" {
@@ -112,4 +113,4 @@ declare module "ip" {
* @param cidr CIDR address.
*/
export function cidrSubnet(cidr: string): SubnetInfo;
}
}