v2
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
export declare const BITS = 32;
|
||||
export declare const GROUPS = 4;
|
||||
export declare const RE_ADDRESS: RegExp;
|
||||
export declare const RE_SUBNET_STRING: RegExp;
|
||||
/**
|
||||
* The IANA IPv4 Special-Purpose Address Registry
|
||||
* (https://www.iana.org/assignments/iana-ipv4-special-registry/), one entry
|
||||
* per block: `[cidr, name, globallyReachable]`. A `null` reachability means
|
||||
* the registry leaves the column blank and the block inherits the answer of
|
||||
* the block containing it (or is global when nothing contains it).
|
||||
*
|
||||
* `Address4.isGlobal()` answers from the most specific entry containing the
|
||||
* address. `test/data/iana-corpus.json` is generated from the registry's CSV
|
||||
* and pins this table to it.
|
||||
*/
|
||||
export declare const SPECIAL_PURPOSE: ReadonlyArray<readonly [string, string, boolean | null]>;
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.SPECIAL_PURPOSE = exports.RE_SUBNET_STRING = exports.RE_ADDRESS = exports.GROUPS = exports.BITS = void 0;
|
||||
exports.BITS = 32;
|
||||
exports.GROUPS = 4;
|
||||
// Each octet is 0-255 written without a leading zero. A leading zero is
|
||||
// octal to the WHATWG URL parser, inet_aton, and getaddrinfo, but decimal to
|
||||
// parseInt(part, 10), so accepting the notation would make this library
|
||||
// disagree with the network stack about which host a string names.
|
||||
exports.RE_ADDRESS = /^(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])$/g;
|
||||
exports.RE_SUBNET_STRING = /\/\d{1,2}$/;
|
||||
/**
|
||||
* The IANA IPv4 Special-Purpose Address Registry
|
||||
* (https://www.iana.org/assignments/iana-ipv4-special-registry/), one entry
|
||||
* per block: `[cidr, name, globallyReachable]`. A `null` reachability means
|
||||
* the registry leaves the column blank and the block inherits the answer of
|
||||
* the block containing it (or is global when nothing contains it).
|
||||
*
|
||||
* `Address4.isGlobal()` answers from the most specific entry containing the
|
||||
* address. `test/data/iana-corpus.json` is generated from the registry's CSV
|
||||
* and pins this table to it.
|
||||
*/
|
||||
exports.SPECIAL_PURPOSE = [
|
||||
['0.0.0.0/8', 'This network', false],
|
||||
['0.0.0.0/32', 'This host on this network', false],
|
||||
['10.0.0.0/8', 'Private-Use', false],
|
||||
['100.64.0.0/10', 'Shared Address Space', false],
|
||||
['127.0.0.0/8', 'Loopback', false],
|
||||
['169.254.0.0/16', 'Link Local', false],
|
||||
['172.16.0.0/12', 'Private-Use', false],
|
||||
['192.0.0.0/24', 'IETF Protocol Assignments', false],
|
||||
['192.0.0.0/29', 'IPv4 Service Continuity Prefix', false],
|
||||
['192.0.0.8/32', 'IPv4 dummy address', false],
|
||||
['192.0.0.9/32', 'Port Control Protocol Anycast', true],
|
||||
['192.0.0.10/32', 'Traversal Using Relays around NAT Anycast', true],
|
||||
['192.0.0.170/32', 'NAT64/DNS64 Discovery', false],
|
||||
['192.0.0.171/32', 'NAT64/DNS64 Discovery', false],
|
||||
['192.0.2.0/24', 'Documentation (TEST-NET-1)', false],
|
||||
['192.31.196.0/24', 'AS112-v4', true],
|
||||
['192.52.193.0/24', 'AMT', true],
|
||||
['192.88.99.0/24', 'Deprecated (6to4 Relay Anycast)', null],
|
||||
['192.88.99.2/32', '6a44-relay anycast address', false],
|
||||
['192.168.0.0/16', 'Private-Use', false],
|
||||
['192.175.48.0/24', 'Direct Delegation AS112 Service', true],
|
||||
['198.18.0.0/15', 'Benchmarking', false],
|
||||
['198.51.100.0/24', 'Documentation (TEST-NET-2)', false],
|
||||
['203.0.113.0/24', 'Documentation (TEST-NET-3)', false],
|
||||
['240.0.0.0/4', 'Reserved', false],
|
||||
['255.255.255.255/32', 'Limited Broadcast', false],
|
||||
];
|
||||
//# sourceMappingURL=constants.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/v4/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,IAAI,GAAG,EAAE,CAAC;AACV,QAAA,MAAM,GAAG,CAAC,CAAC;AAExB,wEAAwE;AACxE,6EAA6E;AAC7E,wEAAwE;AACxE,mEAAmE;AACtD,QAAA,UAAU,GACrB,+LAA+L,CAAC;AAErL,QAAA,gBAAgB,GAAG,YAAY,CAAC;AAE7C;;;;;;;;;;GAUG;AACU,QAAA,eAAe,GAA6D;IACvF,CAAC,WAAW,EAAE,cAAc,EAAE,KAAK,CAAC;IACpC,CAAC,YAAY,EAAE,2BAA2B,EAAE,KAAK,CAAC;IAClD,CAAC,YAAY,EAAE,aAAa,EAAE,KAAK,CAAC;IACpC,CAAC,eAAe,EAAE,sBAAsB,EAAE,KAAK,CAAC;IAChD,CAAC,aAAa,EAAE,UAAU,EAAE,KAAK,CAAC;IAClC,CAAC,gBAAgB,EAAE,YAAY,EAAE,KAAK,CAAC;IACvC,CAAC,eAAe,EAAE,aAAa,EAAE,KAAK,CAAC;IACvC,CAAC,cAAc,EAAE,2BAA2B,EAAE,KAAK,CAAC;IACpD,CAAC,cAAc,EAAE,gCAAgC,EAAE,KAAK,CAAC;IACzD,CAAC,cAAc,EAAE,oBAAoB,EAAE,KAAK,CAAC;IAC7C,CAAC,cAAc,EAAE,+BAA+B,EAAE,IAAI,CAAC;IACvD,CAAC,eAAe,EAAE,2CAA2C,EAAE,IAAI,CAAC;IACpE,CAAC,gBAAgB,EAAE,uBAAuB,EAAE,KAAK,CAAC;IAClD,CAAC,gBAAgB,EAAE,uBAAuB,EAAE,KAAK,CAAC;IAClD,CAAC,cAAc,EAAE,4BAA4B,EAAE,KAAK,CAAC;IACrD,CAAC,iBAAiB,EAAE,UAAU,EAAE,IAAI,CAAC;IACrC,CAAC,iBAAiB,EAAE,KAAK,EAAE,IAAI,CAAC;IAChC,CAAC,gBAAgB,EAAE,iCAAiC,EAAE,IAAI,CAAC;IAC3D,CAAC,gBAAgB,EAAE,4BAA4B,EAAE,KAAK,CAAC;IACvD,CAAC,gBAAgB,EAAE,aAAa,EAAE,KAAK,CAAC;IACxC,CAAC,iBAAiB,EAAE,iCAAiC,EAAE,IAAI,CAAC;IAC5D,CAAC,eAAe,EAAE,cAAc,EAAE,KAAK,CAAC;IACxC,CAAC,iBAAiB,EAAE,4BAA4B,EAAE,KAAK,CAAC;IACxD,CAAC,gBAAgB,EAAE,4BAA4B,EAAE,KAAK,CAAC;IACvD,CAAC,aAAa,EAAE,UAAU,EAAE,KAAK,CAAC;IAClC,CAAC,oBAAoB,EAAE,mBAAmB,EAAE,KAAK,CAAC;CACnD,CAAC","sourcesContent":["export const BITS = 32;\nexport const GROUPS = 4;\n\n// Each octet is 0-255 written without a leading zero. A leading zero is\n// octal to the WHATWG URL parser, inet_aton, and getaddrinfo, but decimal to\n// parseInt(part, 10), so accepting the notation would make this library\n// disagree with the network stack about which host a string names.\nexport const RE_ADDRESS =\n /^(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])$/g;\n\nexport const RE_SUBNET_STRING = /\\/\\d{1,2}$/;\n\n/**\n * The IANA IPv4 Special-Purpose Address Registry\n * (https://www.iana.org/assignments/iana-ipv4-special-registry/), one entry\n * per block: `[cidr, name, globallyReachable]`. A `null` reachability means\n * the registry leaves the column blank and the block inherits the answer of\n * the block containing it (or is global when nothing contains it).\n *\n * `Address4.isGlobal()` answers from the most specific entry containing the\n * address. `test/data/iana-corpus.json` is generated from the registry's CSV\n * and pins this table to it.\n */\nexport const SPECIAL_PURPOSE: ReadonlyArray<readonly [string, string, boolean | null]> = [\n ['0.0.0.0/8', 'This network', false],\n ['0.0.0.0/32', 'This host on this network', false],\n ['10.0.0.0/8', 'Private-Use', false],\n ['100.64.0.0/10', 'Shared Address Space', false],\n ['127.0.0.0/8', 'Loopback', false],\n ['169.254.0.0/16', 'Link Local', false],\n ['172.16.0.0/12', 'Private-Use', false],\n ['192.0.0.0/24', 'IETF Protocol Assignments', false],\n ['192.0.0.0/29', 'IPv4 Service Continuity Prefix', false],\n ['192.0.0.8/32', 'IPv4 dummy address', false],\n ['192.0.0.9/32', 'Port Control Protocol Anycast', true],\n ['192.0.0.10/32', 'Traversal Using Relays around NAT Anycast', true],\n ['192.0.0.170/32', 'NAT64/DNS64 Discovery', false],\n ['192.0.0.171/32', 'NAT64/DNS64 Discovery', false],\n ['192.0.2.0/24', 'Documentation (TEST-NET-1)', false],\n ['192.31.196.0/24', 'AS112-v4', true],\n ['192.52.193.0/24', 'AMT', true],\n ['192.88.99.0/24', 'Deprecated (6to4 Relay Anycast)', null],\n ['192.88.99.2/32', '6a44-relay anycast address', false],\n ['192.168.0.0/16', 'Private-Use', false],\n ['192.175.48.0/24', 'Direct Delegation AS112 Service', true],\n ['198.18.0.0/15', 'Benchmarking', false],\n ['198.51.100.0/24', 'Documentation (TEST-NET-2)', false],\n ['203.0.113.0/24', 'Documentation (TEST-NET-3)', false],\n ['240.0.0.0/4', 'Reserved', false],\n ['255.255.255.255/32', 'Limited Broadcast', false],\n];\n"]}
|
||||
Reference in New Issue
Block a user