@terascope/ip-utils / utils/ip-range / IPRange
Class: IPRange
Defined in: utils/ip-range.ts:4
Properties
| Property | Modifier | Type | Defined in |
|---|---|---|---|
maxValue | readonly | IPAddress | utils/ip-range.ts:6 |
minValue | readonly | IPAddress | utils/ip-range.ts:5 |
version | readonly | 4 | 6 | utils/ip-range.ts:7 |
Methods
contains()
contains(
input):boolean
Defined in: utils/ip-range.ts:46
Returns true if the given IP address falls within this range (inclusive). The IP version must match the range version exactly.
Parameters
| Parameter | Type |
|---|---|
input | string | IPAddress |
Returns
boolean
containsCIDR()
containsCIDR(
cidr):boolean
Defined in: utils/ip-range.ts:64
Returns true if the given CIDR block is fully contained within this range. Both the CIDR's network address (first) and broadcast address (last) must fall within [minValue, maxValue]. This ensures exclusive range bounds are respected for the entire CIDR, not just the usable host addresses.
Parameters
| Parameter | Type |
|---|---|
cidr | CIDRBlock |
Returns
boolean
toString()
toString():
string
Defined in: utils/ip-range.ts:38
Returns
string
from()
staticfrom(min,max):IPRange
Defined in: utils/ip-range.ts:21
Build an IPRange from two IPAddress boundary values (inclusive). Both must be the same IP version and min must be <= max.
Parameters
| Parameter | Type |
|---|---|
min | IPAddress |
max | IPAddress |
Returns
IPRange