Installation
npm install --save @types/cidr-matcher
Summary
This package contains type definitions for cidr-matcher (https://github.com/pracucci/node-cidr-matcher).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cidr-matcher.
index.d.ts
declare class Matcher {
/**
* Constructs a matcher for a list of CIDR ranges
*
* @param cidrRanges - list of IPv4 & IPv6 CIDR ranges
*/
constructor(cidrRanges?: readonly string[]);
/**
* Does the CIDR ranges include the IP address
*
* @param ipAddress - ip address to check
* @returns whether the IP address is in the range
*/
contains(ipAddress: string): boolean;
/**
* Does the CIDR ranges includes any of the IP addresses
*
* @param ipAddresses - ip addresses to check
* @returns whether any of the IP addresses are in the range
*/
containsAny(ipAddresses: string[]): boolean;
/**
* Adds a CIDR range to the matcher
*
* @param cidr - CIDR range to add
*/
addNetworkClass(cidr: string): void;
}
export = Matcher;
Additional Details
- Last updated: Mon, 06 Nov 2023 22:41:05 GMT
- Dependencies: none
Credits
These definitions were written by Sam Murphy.