Initial commit

This commit is contained in:
mats committed 2026-10-19 16:04:17 +02:00
commit afed023152
8152 files changed
+2086461

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
Copyright (c) 2017 Thomas Parisot, 2018 Rémi Berson
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+368
View File
@@ -0,0 +1,368 @@
# tldts - Blazing Fast URL Parsing
`tldts` is a JavaScript library to extract hostnames, domains, public suffixes, top-level domains and subdomains from URLs.
**Features**:
1. Tuned for **performance** (order of 0.1 to 1 μs per input)
2. Handles both URLs and hostnames
3. Full Unicode/IDNA support
4. Support parsing email addresses
5. Detect IPv4 and IPv6 addresses
6. Continuously updated version of the public suffix list
7. **TypeScript**, ships with `umd`, `esm`, `cjs` bundles and _type definitions_
8. Small bundles and small memory footprint
9. Battle tested: full test coverage and production use
# Install
```bash
npm install --save tldts
```
# Usage
Using the command-line interface:
```js
$ npx tldts 'http://www.writethedocs.org/conf/eu/2017/'
{
"domain": "writethedocs.org",
"domainWithoutSuffix": "writethedocs",
"hostname": "www.writethedocs.org",
"isIcann": true,
"isIp": false,
"isPrivate": false,
"publicSuffix": "org",
"subdomain": "www"
}
```
Programmatically:
```js
const { parse } = require('tldts');
// Retrieving hostname related informations of a given URL
parse('http://www.writethedocs.org/conf/eu/2017/');
// { domain: 'writethedocs.org',
// domainWithoutSuffix: 'writethedocs',
// hostname: 'www.writethedocs.org',
// isIcann: true,
// isIp: false,
// isPrivate: false,
// publicSuffix: 'org',
// subdomain: 'www' }
```
Modern _ES6 modules import_ is also supported:
```js
import { parse } from 'tldts';
```
Alternatively, you can try it _directly in your browser_ here: https://npm.runkit.com/tldts
# API
- `tldts.parse(url | hostname, options)`
- `tldts.getHostname(url | hostname, options)`
- `tldts.getDomain(url | hostname, options)`
- `tldts.getFullDomain(url | hostname, options)`
- `tldts.getPublicSuffix(url | hostname, options)`
- `tldts.getSubdomain(url, | hostname, options)`
- `tldts.getDomainWithoutSuffix(url | hostname, options)`
The behavior of `tldts` can be customized using an `options` argument for all
the functions exposed as part of the public API. This is useful to both change
the behavior of the library as well as fine-tune the performance depending on
your inputs.
```js
{
// Use suffixes from ICANN section (default: true)
allowIcannDomains: boolean;
// Use suffixes from Private section (default: false)
allowPrivateDomains: boolean;
// Extract and validate hostname (default: true)
// When set to `false`, inputs will be considered valid hostnames.
extractHostname: boolean;
// Validate hostnames after parsing (default: true)
// If a hostname is not valid, not further processing is performed. When set
// to `false`, inputs to the library will be considered valid and parsing will
// proceed regardless.
validateHostname: boolean;
// Perform IP address detection (default: true).
detectIp: boolean;
// Detect IANA special-use domains (RFC 6761 et al.) and expose the result as
// `isSpecialUse` (default: false). Off by default so the common path does no
// extra work; the field stays `null` unless this is enabled.
detectSpecialUse: boolean;
// Assume that both URLs and hostnames can be given as input (default: true)
// If set to `false` we assume only URLs will be given as input, which
// speed-ups processing.
mixedInputs: boolean;
// Specifies extra valid suffixes (default: null)
validHosts: string[] | null;
}
```
The `parse` method returns handy **properties about a URL or a hostname**.
```js
const tldts = require('tldts');
tldts.parse('https://spark-public.s3.amazonaws.com/dataanalysis/loansData.csv');
// { domain: 'amazonaws.com',
// domainWithoutSuffix: 'amazonaws',
// hostname: 'spark-public.s3.amazonaws.com',
// isIcann: true,
// isIp: false,
// isPrivate: false,
// publicSuffix: 'com',
// subdomain: 'spark-public.s3' }
tldts.parse(
'https://spark-public.s3.amazonaws.com/dataanalysis/loansData.csv',
{ allowPrivateDomains: true },
);
// { domain: 'spark-public.s3.amazonaws.com',
// domainWithoutSuffix: 'spark-public',
// hostname: 'spark-public.s3.amazonaws.com',
// isIcann: false,
// isIp: false,
// isPrivate: true,
// publicSuffix: 's3.amazonaws.com',
// subdomain: '' }
tldts.parse('gopher://domain.unknown/');
// { domain: 'domain.unknown',
// domainWithoutSuffix: 'domain',
// hostname: 'domain.unknown',
// isIcann: false,
// isIp: false,
// isPrivate: false,
// publicSuffix: 'unknown',
// subdomain: '' }
tldts.parse('https://192.168.0.0'); // IPv4
// { domain: null,
// domainWithoutSuffix: null,
// hostname: '192.168.0.0',
// isIcann: null,
// isIp: true,
// isPrivate: null,
// publicSuffix: null,
// subdomain: null }
tldts.parse('https://[::1]'); // IPv6
// { domain: null,
// domainWithoutSuffix: null,
// hostname: '::1',
// isIcann: null,
// isIp: true,
// isPrivate: null,
// publicSuffix: null,
// subdomain: null }
tldts.parse('tldts@emailprovider.co.uk'); // email
// { domain: 'emailprovider.co.uk',
// domainWithoutSuffix: 'emailprovider',
// hostname: 'emailprovider.co.uk',
// isIcann: true,
// isIp: false,
// isPrivate: false,
// publicSuffix: 'co.uk',
// subdomain: '' }
```
| Property Name | Type | Description |
| :-------------------- | :----- | :---------------------------------------------- |
| `hostname` | `str` | `hostname` of the input extracted automatically |
| `domain` | `str` | Domain (tld + sld) |
| `domainWithoutSuffix` | `str` | Domain without public suffix |
| `subdomain` | `str` | Sub domain (what comes after `domain`) |
| `publicSuffix` | `str` | Public Suffix (tld) of `hostname` |
| `isIcann` | `bool` | Does TLD come from ICANN part of the list |
| `isPrivate` | `bool` | Does TLD come from Private part of the list |
| `isIP` | `bool` | Is `hostname` an IP address? |
| `isSpecialUse` | `bool` | Is `hostname` an IANA special-use domain? |
## Special-use domains (RFC 6761 / IANA)
Set `{ detectSpecialUse: true }` to flag reserved special-use names such as `localhost`, `*.test`, `*.local`, `*.onion`, and `home.arpa` via the `isSpecialUse` result field. `isIcann`/`isPrivate` don't identify these: most aren't in the Public Suffix List, and the few that are (e.g. `onion`, `home.arpa`) appear there as ordinary ICANN suffixes. The field is `null` unless the option is enabled, so the default path does no extra work:
```js
parse('http://printer.local/', { detectSpecialUse: true });
// { ...
// isSpecialUse: true,
// publicSuffix: 'local',
// subdomain: '' }
```
The list tracks the IANA [Special-Use Domain Names](https://www.iana.org/assignments/special-use-domain-names/) registry.
## Single purpose methods
These methods are shorthands if you want to retrieve only a single value (and
will perform better than `parse` because less work will be needed).
### getHostname(url | hostname, options?)
Returns the hostname from a given string.
```javascript
const { getHostname } = require('tldts');
getHostname('google.com'); // returns `google.com`
getHostname('fr.google.com'); // returns `fr.google.com`
getHostname('fr.google.google'); // returns `fr.google.google`
getHostname('foo.google.co.uk'); // returns `foo.google.co.uk`
getHostname('t.co'); // returns `t.co`
getHostname('fr.t.co'); // returns `fr.t.co`
getHostname(
'https://user:password@example.co.uk:8080/some/path?and&query#hash',
); // returns `example.co.uk`
```
### getDomain(url | hostname, options?)
Returns the fully qualified domain from a given string.
```javascript
const { getDomain } = require('tldts');
getDomain('google.com'); // returns `google.com`
getDomain('fr.google.com'); // returns `google.com`
getDomain('fr.google.google'); // returns `google.google`
getDomain('foo.google.co.uk'); // returns `google.co.uk`
getDomain('t.co'); // returns `t.co`
getDomain('fr.t.co'); // returns `t.co`
getDomain('https://user:password@example.co.uk:8080/some/path?and&query#hash'); // returns `example.co.uk`
```
### getFullDomain(url | hostname, options?)
Returns the full domain — the subdomain together with the registrable domain (as
returned by `getDomain(...)`), i.e. the whole hostname _including_ any subdomain —
or `null` when the input has no registrable domain (IP address, single label,
bare public suffix, …). The result is the normalized hostname (lower-cased,
trailing dot stripped); it is not a DNS-absolute name (no trailing root dot) and
no IDNA/punycode conversion is performed.
```javascript
const { getFullDomain } = require('tldts');
getFullDomain('google.com'); // returns `google.com`
getFullDomain('fr.google.com'); // returns `fr.google.com`
getFullDomain('foo.google.co.uk'); // returns `foo.google.co.uk`
getFullDomain('t.co'); // returns `t.co`
getFullDomain('fr.t.co'); // returns `fr.t.co`
getFullDomain('1.2.3.4'); // returns null (no registrable domain)
getFullDomain('localhost'); // returns null
```
### getDomainWithoutSuffix(url | hostname, options?)
Returns the domain (as returned by `getDomain(...)`) without the public suffix part.
```javascript
const { getDomainWithoutSuffix } = require('tldts');
getDomainWithoutSuffix('google.com'); // returns `google`
getDomainWithoutSuffix('fr.google.com'); // returns `google`
getDomainWithoutSuffix('fr.google.google'); // returns `google`
getDomainWithoutSuffix('foo.google.co.uk'); // returns `google`
getDomainWithoutSuffix('t.co'); // returns `t`
getDomainWithoutSuffix('fr.t.co'); // returns `t`
getDomainWithoutSuffix(
'https://user:password@example.co.uk:8080/some/path?and&query#hash',
); // returns `example`
```
### getSubdomain(url | hostname, options?)
Returns the complete subdomain for a given string.
```javascript
const { getSubdomain } = require('tldts');
getSubdomain('google.com'); // returns ``
getSubdomain('fr.google.com'); // returns `fr`
getSubdomain('google.co.uk'); // returns ``
getSubdomain('foo.google.co.uk'); // returns `foo`
getSubdomain('moar.foo.google.co.uk'); // returns `moar.foo`
getSubdomain('t.co'); // returns ``
getSubdomain('fr.t.co'); // returns `fr`
getSubdomain(
'https://user:password@secure.example.co.uk:443/some/path?and&query#hash',
); // returns `secure`
```
### getPublicSuffix(url | hostname, options?)
Returns the [public suffix][] for a given string.
```javascript
const { getPublicSuffix } = require('tldts');
getPublicSuffix('google.com'); // returns `com`
getPublicSuffix('fr.google.com'); // returns `com`
getPublicSuffix('google.co.uk'); // returns `co.uk`
getPublicSuffix('s3.amazonaws.com'); // returns `com`
getPublicSuffix('s3.amazonaws.com', { allowPrivateDomains: true }); // returns `s3.amazonaws.com`
getPublicSuffix('tld.is.unknown'); // returns `unknown`
```
# Troubleshooting
## Retrieving subdomain of `localhost` and custom hostnames
`tldts` methods `getDomain` and `getSubdomain` are designed to **work only with _known and valid_ TLDs**.
This way, you can trust what a domain is.
`localhost` is a valid hostname but not a TLD. You can pass additional options to each method exposed by `tldts`:
```js
const tldts = require('tldts');
tldts.getDomain('localhost'); // returns null
tldts.getSubdomain('vhost.localhost'); // returns null
tldts.getDomain('localhost', { validHosts: ['localhost'] }); // returns 'localhost'
tldts.getSubdomain('vhost.localhost', { validHosts: ['localhost'] }); // returns 'vhost'
```
## Updating the TLDs List
`tldts` made the opinionated choice of shipping with a list of suffixes directly
in its bundle. There is currently no mechanism to update the lists yourself, but
we make sure that the version shipped is always up-to-date.
If you keep `tldts` updated, the lists should be up-to-date as well!
# Performance
`tldts` is the _fastest JavaScript library_ available for parsing hostnames. It is able to parse _millions of inputs per second_ (typically 2-3M depending on your hardware and inputs). It also offers granular options to fine-tune the behavior and performance of the library depending on the kind of inputs you are dealing with (e.g.: if you know you only manipulate valid hostnames you can disable the hostname extraction step with `{ extractHostname: false }`).
Please see [this detailed comparison](./comparison/comparison.md) with other available libraries.
## Contributors
`tldts` is based upon the excellent `tld.js` library and would not exist without
the many contributors who worked on the project:
<a href="graphs/contributors"><img src="https://opencollective.com/tldjs/contributors.svg?width=890" /></a>
This project would not be possible without the amazing Mozilla's
[public suffix list][]. Thank you for your hard work!
# License
[MIT License](LICENSE).
[badge-ci]: https://secure.travis-ci.org/remusao/tldts.svg?branch=master
[badge-downloads]: https://img.shields.io/npm/dm/tldts.svg
[public suffix list]: https://publicsuffix.org/list/
[list the recent changes]: https://github.com/publicsuffix/list/commits/master
[changes Atom Feed]: https://github.com/publicsuffix/list/commits/master.atom
[public suffix]: https://publicsuffix.org/learn/
Generated Vendored Executable
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env node
'use strict';
const { parse } = require('..');
const readline = require('readline');
if (process.argv.length > 2) {
// URL(s) was specified in the command arguments
console.log(
JSON.stringify(parse(process.argv[process.argv.length - 1]), null, 2),
);
} else {
// No arguments were specified, read URLs from each line of STDIN
const rlInterface = readline.createInterface({
input: process.stdin,
});
rlInterface.on('line', function (line) {
console.log(JSON.stringify(parse(line), null, 2));
});
}
+1170
View File
File diff suppressed because it is too large. Load diff
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":["../../../tldts-core/src/domain.ts","../../../tldts-core/src/domain-without-suffix.ts","../../../tldts-core/src/extract-hostname.ts","../../../tldts-core/src/is-ip.ts","../../../tldts-core/src/is-special-use.ts","../../../tldts-core/src/is-valid.ts","../../../tldts-core/src/options.ts","../../../tldts-core/src/subdomain.ts","../../../tldts-core/src/factory.ts","../../../tldts-core/src/lookup/fast-path.ts","../../src/data/trie.ts","../../src/suffix-trie.ts","../../index.ts"],"sourcesContent":["import { IOptions } from './options';\n\n/**\n * Check if `vhost` is a valid suffix of `hostname` (top-domain)\n *\n * It means that `vhost` needs to be a suffix of `hostname` and we then need to\n * make sure that: either they are equal, or the character preceding `vhost` in\n * `hostname` is a '.' (it should not be a partial label).\n *\n * * hostname = 'not.evil.com' and vhost = 'vil.com' => not ok\n * * hostname = 'not.evil.com' and vhost = 'evil.com' => ok\n * * hostname = 'not.evil.com' and vhost = 'not.evil.com' => ok\n */\nfunction shareSameDomainSuffix(hostname: string, vhost: string): boolean {\n if (hostname.endsWith(vhost)) {\n return (\n hostname.length === vhost.length ||\n hostname[hostname.length - vhost.length - 1] === '.'\n );\n }\n\n return false;\n}\n\n/**\n * Given a hostname and its public suffix, extract the general domain.\n */\nfunction extractDomainWithSuffix(\n hostname: string,\n publicSuffix: string,\n): string {\n // Locate the index of the last '.' in the part of the `hostname` preceding\n // the public suffix.\n //\n // examples:\n // 1. not.evil.co.uk => evil.co.uk\n // ^ ^\n // | | start of public suffix\n // | index of the last dot\n //\n // 2. example.co.uk => example.co.uk\n // ^ ^\n // | | start of public suffix\n // |\n // | (-1) no dot found before the public suffix\n const publicSuffixIndex = hostname.length - publicSuffix.length - 2;\n const lastDotBeforeSuffixIndex = hostname.lastIndexOf('.', publicSuffixIndex);\n\n // No '.' found, then `hostname` is the general domain (no sub-domain)\n if (lastDotBeforeSuffixIndex === -1) {\n return hostname;\n }\n\n // Extract the part between the last '.'\n return hostname.slice(lastDotBeforeSuffixIndex + 1);\n}\n\n/**\n * Detects the domain based on rules and upon and a host string\n */\nexport default function getDomain(\n suffix: string,\n hostname: string,\n options: IOptions,\n): string | null {\n // Check if `hostname` ends with a member of `validHosts`.\n if (options.validHosts !== null) {\n const validHosts = options.validHosts;\n for (const vhost of validHosts) {\n if (/*@__INLINE__*/ shareSameDomainSuffix(hostname, vhost)) {\n return vhost;\n }\n }\n }\n\n let numberOfLeadingDots = 0;\n if (hostname.startsWith('.')) {\n while (\n numberOfLeadingDots < hostname.length &&\n hostname[numberOfLeadingDots] === '.'\n ) {\n numberOfLeadingDots += 1;\n }\n }\n\n // If `hostname` is a valid public suffix, then there is no domain to return.\n // Since we already know that `getPublicSuffix` returns a suffix of `hostname`\n // there is no need to perform a string comparison and we only compare the\n // size.\n if (suffix.length === hostname.length - numberOfLeadingDots) {\n return null;\n }\n\n // To extract the general domain, we start by identifying the public suffix\n // (if any), then consider the domain to be the public suffix with one added\n // level of depth. (e.g.: if hostname is `not.evil.co.uk` and public suffix:\n // `co.uk`, then we take one more level: `evil`, giving the final result:\n // `evil.co.uk`).\n return /*@__INLINE__*/ extractDomainWithSuffix(hostname, suffix);\n}\n","/**\n * Return the part of domain without suffix.\n *\n * Example: for domain 'foo.com', the result would be 'foo'.\n */\nexport default function getDomainWithoutSuffix(\n domain: string,\n suffix: string,\n): string {\n // Note: here `domain` and `suffix` cannot have the same length because in\n // this case we set `domain` to `null` instead. It is thus safe to assume\n // that `suffix` is shorter than `domain`.\n return domain.slice(0, -suffix.length - 1);\n}\n","/**\n * Matches an ASCII tab (U+0009) or newline (U+000A / U+000D). The WHATWG URL\n * parser strips these before parsing; we only allocate a cleaned copy (and\n * re-parse) on the rare input that actually contains one.\n */\nconst CONTROL_CHARS = /[\\t\\n\\r]/g;\n\n// Set by `extractHostname` (a module-scope flag, read synchronously by\n// `parseImpl` right after the call — same pattern as the reused RESULT object).\n// `true` ONLY when extraction validated the returned host inline (a confirmed-\n// valid, \"simple\" authority) so `parseImpl` can skip the separate\n// `isValidHostname` pass. `false` in every other case (validation disabled, a\n// compleLine truncated
+12
View File
@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.exceptionsRoot = exports.rulesRoot = exports.labelText = exports.edgeChild = exports.edgeLength = exports.edgeStart = exports.nodeFlags = void 0;
// Auto-generated flat public-suffix trie. Do not edit.
exports.nodeFlags = new Uint8Array([1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 2, 2, 0, 2, 2, 0, 2, 0, 0, 1, 0, 0, 2, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 2, 1, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0,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1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0]);
exports.edgeStart = new Uint16Array([0, 0, 0, 10, 11, 18, 106, 111, 117, 124, 130, 136, 145, 146, 147, 148, 149, 150, 151, 153, 154, 155, 157, 159, 226, 239, 241, 242, 243, 258, 265, 266, 269, 270, 271, 274, 276, 295, 296, 298, 307, 312, 329, 330, 333, 335, 336, 338, 372, 373, 375, 378, 379, 383, 385, 389, 392, 424, 427, 440, 441, 449, 450, 452, 462, 476, 477, 478, 487, 488, 525, 530, 546, 566, 572, 614, 615, 642, 669, 670, 818, 824, 827, 828, 829, 834, 839, 848, 870, 871, 872, 873, 874, 875, 876, 894, 896, 897, 900, 902, 903, 905, 907, 922, 937, 942, 943, 945, 946, 947, 948, 949, 951, 954, 959, 960, 961, 963, 964, 967, 970, 971, 972, 985, 987, 999, 1010, 1018, 1020, 1061, 1064, 1068, 1069, 1071, 1074, 1085, 1087, 1097, 1099, 1105, 1107, 1108, 1110, 1113, 1114, 1115, 1168, 1170, 1172, 1192, 1193, 1194, 1195, 1197, 1208, 1239, 1250, 1262, 1271, 1278, 1283, 1296, 1307, 1320, 1321, 1332, 1366, 1367, 1368, 1383, 1398, 1470, 1471, 1473, 1474, 1508, 1509, 1510, 1511, 1514, 1518, 1520, 1549, 1550, 1558, 1559, 1560, 1562, 1564, 1565, 1567, 1568, 1569, 1580, 1581, 1582, 1583, 1584, 1585, 1586, 1587, 1588, 1589, 1590, 1591, 1592, 1593, 1595, 1596, 1597, 2051, 2054, 2055, 2057, 2064, 2071, 2081, 2085, 2096, 2097, 2098, 2110, 2111, 2113, 2115, 2116, 2123, 2124, 2126, 2127, 2129, 2130, 2131, 2132, 2133, 2207, 2209, 2230, 2231, 2232, 2234, 2260, 2261, 2312, 2313, 2315, 2322, 2328, 2338, 2348, 2401, 2402, 2403, 2413, 2427, 2428, 2431, 2438, 2439, 2447, 2448, 2449, 2450, 2451, 2462, 2463, 2464, 2466, 2467, 2468, 2477, 2489, 2495, 2527, 2531, 2533, 2534, 2536, 2537, 2548, 2549, 2551, 2559, 2566, 2572, 2577, 2578, 2584, 2587, 2593, 2600, 2601, 2608, 2616, 2617, 2618, 2656, 2662, 2677, 2678, 2683, 2701, 2732, 2750, 2752, 2755, 2763, 2765, 2772, 2824, 2848, 2849, 2850, 2851, 2852, 2853, 2854, 2861, 2862, 2863, 2864, 2865, 2866, 2868, 2869, 2873, 2953, 2966, 2967, 3404, 3408, 3422, 3474, 3502, 3524, 3582, 3604, 3619, 3682, 3733, 3771, 3807, 3832, 3974, 4020, 4071, 4090, 4124, 4139, 4159, 4189, 4220, 4243, 4274, 4304, 4336, 4363, 4438, 4460, 4498, 4508, 4542, 4561, 4587, 4629, 4679, 4705, 4774, 4775, 4777, 4800, 4823, 4859, 4890, 4907, 4964, 4977, 5001, 5030, 5032, 5066, 5082, 5110, 5415, 5424, 5433, 5440, 5457, 5461, 5467, 5506, 5508, 5515, 5522, 5531, 5538, 5539, 5540, 5552, 5555, 5570, 5571, 5580, 5581, 5590, 5599, 5605, 5607, 5608, 5609, 5646, 5647, 5649, 5657, 5664, 5677, 5681, 5683, 5684, 5690, 5697, 5711, 5721, 5726, 5734, 5742, 5748, 5749, 5753, 5755, 5756, 5768, 5840, 5841, 5842, 5843, 5845, 5846, 5849, 5851, 5854, 5858, 5859, 5860, 5866, 5867, 5868, 5870, 5872, 5874, 5875, 5876, 5879, 5881, 5884, 5885, 5887, 6085, 6092, 6093, 6094, 6104, 6109, 6126, 6140, 6149, 6150, 6151, 6155, 6156, 6158, 6160, 6166, 6167, 6170, 6171, 6173, 6174, 6175, 7075, 7078, 7082, 7100, 7109, 7112, 7119, 7120, 7122, 7123, 7124, 7126, 7178, 7179, 7182, 7183, 7300, 7301, 7312, 7323, 7330, 7333, 7342, 7343, 7344, 7359, 7414, 7605, 7607, 7608, 7610, 7615, 7628, 7643, 7650, 7659, 7662, 7665, 7672, 7680, 7684, 7685, 7686, 7700, 7704, 7713, 7714, 7715, 7719, 7754, 7755, 7772, 7779, 7787, 7788, 7793, 7801, 7845, 7846, 7852, 7855, 7866, 7871, 7872, 7875, 7877, 7912, 7913, 7919, 7926, 7927, 7936, 7945, 7960, 7964, 8016, 8017, 8022, 8024, 8027, 8029, 8030, 8031, 8040, 8054, 8062, 8076, 8088, 8089, 8091, 8093, 8115, 8126, 8132, 8133, 8145, 8157, 8244, 8256, 8264, 8267, 8273, 8298, 8301, 8302, 8303, 8305, 8308, 8311, 8322, 8324, 8326, 8354, 8428, 8435, 8439, 8440, 8449, 8471, 8472, 8477, 8478, 8557, 8559, 8561, 8570, 8574, 8580, 8586, 8592, 8602, 8607, 8608, 8626, 8637, 8642, 8647, 8657, 8663, 8667, 8673, 8679, 10288, 10289, 10290, 10297, 10299]);
exports.edgeLength = new Uint8Array([3, 3, 3, 3, 3, 3, 3, 3, 5, 8, 8, 2, 2, 3, 3, 3, 3, 3, 8, 5, 5, 5, 5, 5, 3, 3, 5, 5, 9, 12, 19, 8, 19, 8, 11, 9, 9, 8, 7, 7, 6, 8, 9, 16, 10, 7, 7, 11, 8, 6, 6, 9, 7, 11, 7, 14, 4, 4, 4, 4, 4, 4, 10, 7, 6, 6, 6, 6, 10, 10, 6, 10, 10, 22, 11, 9, 10, 10, 10, 9, 10, 8, 7, 7, 7, 8, 21, 13, 11, 11, 9, 10, 9, 13, 10, 8, 8, 9, 12, 9, 7, 10, 7, 7, 13, 7, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 8, 6, 3, 3, 3, 3, 3, 3, 2, 5, 3, 3, 3, 7, 2, 2, 2, 2, 2, 2, 3, 3, 3, 1, 1, 7, 8, 5, 2, 2, 7, 2, 2, 1, 4, 1, 11, 9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, 4, 4, 4, 4, 4, 4, 6, 16, 3, 3, 14, 3, 14, 2, 14, 9, 13, 10, 10, 14, 16, 17, 11, 6, 9, 10, 10, 12, 14, 14, 14, 12, 12, 12, 12, 14, 14, 10, 10, 10, 10, 14, 9, 9, 9, 10, 14, 14, 14, 9, 9, 9, 9, 9, 9, 2, 14, 9, 13, 10, 10, 14, 16, 17, 11, 6, 2, 14, 9, 17, 13, 10, 10, 14, 16, 17, 11, 6, 2, 14, 9, 13, 10, 14, 16, 17, 11, 2, 14, 9, 13, 10, 16, 11, 2, 14, 10, 19, 7, 2, 14, 9, 13, 10, 19, 10, 7, 14, 16, 17, 11, 6, 2, 14, 9, 13, 10, 19, 7, 14, 16, 17, 11, 2, 14, 9, 13, 17, 13, 10, 10, 14, 16, 17, 11, 6, 3, 2, 14, 9, 13, 10, 10, 14, 16, 17, 11, 6, 9, 10, 12, 14, 14, 14, 12, 12, 12, 12, 12, 14, 14, 14, 10, 10, 10, 14, 9, 9, 9, 9, 14, 14, 14, 13, 13, 14, 9, 9, 9, 9, 9, 9, 4, 11, 2, 14, 9, 13, 17, 13, 10, 19, 10, 7, 14, 16, 17, 11, 6, 2, 14, 9, 13, 17, 13, 10, 19, 10, 7, 14, 16, 17, 11, 6, 2, 9, 10, 10, 7, 17, 3, 3, 12, 12, 16, 15, 15, 12, 14, 14, 14, 20, 20, 13, 12, 12, 12, 12, 12, 12, 20, 25, 14, 14, 12, 12, 10, 10, 10, 10, 9, 9, 9, 25, 4, 9, 17, 10, 7, 14, 16, 21, 13, 13, 14, 20, 14, 13, 17, 24, 9, 12, 13, 25, 13, 21, 20, 17, 9, 9, 9, 9, 9, 9, 12, 17, 4, 4, 9, 9, 9, 10, 10, 12, 14, 14, 14, 12, 12, 12, 12, 12, 14, 14, 10, 10, 10, 10, 14, 9, 9, 9, 10, 14, 14, 14, 13, 13, 9, 9, 9, 9, 9, 9, 1, 5, 8, 7, 11, 11, 1, 3, Line truncated
exports.edgeChild = new Uint16Array([0, 0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, 1, 126, 1, 1, 1, 1, 1, 1, 118, 1, 107, 1, 108, 1, 12, 127, 105, 1, 111, 1, 1, 1, 1, 1, 106, 114, 1, 12, 12, 12, 117, 115, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 12, 12, 1, 1, 1, 1, 1, 12, 133, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 12, 135, 1, 1, 1, 1, 1, 1, 1, 1, 136, 137, 12, 12, 134, 132, 44, 44, 139, 49, 49, 138, 141, 140, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 142, 0, 0, 0, 0, 1, 0, 143, 131, 1, 0, 1, 1, 12, 12, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 147, 146, 20, 1, 1, 12, 12, 1, 20, 12, 12, 1, 1, 1, 1, 1, 133, 1, 1, 151, 1, 1, 1, 1, 152, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 1, 1, 135, 1, 1, 151, 1, 1, 1, 1, 152, 1, 1, 133, 1, 1, 1, 151, 1, 1, 1, 1, 152, 1, 1, 133, 1, 1, 1, 1, 1, 1, 1, 1, 133, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 159, 1, 1, 1, 151, 1, 1, 1, 1, 1, 152, 1, 1, 159, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 133, 1, 1, 1, 1, 151, 1, 1, 1, 1, 152, 1, 1, 1, 133, 1, 1, 151, 1, 1, 1, 1, 163, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 1, 166, 1, 1, 159, 1, 1, 1, 1, 1, 151, 1, 1, 1, 1, 1, 152, 1, 1, 159, 1, 1, 1, 1, 1, 151, 1, 1, 1, 1, 1, 152, 1, 153, 157, 157, 12, 1, 12, 165, 1, 1, 1, 1, 1, 157, 157, 157, 153, 1, 1, 1, 156, 157, 160, 164, 1, 1, 1, 1, 156, 156, 1, 1, 155, 153, 153, 156, 169, 155, 169, 1, 1, 167, 1, 155, 154, 156, 1, 1, 1, 1, 156, 1, 158, 1, 1, 1, 12, 1, 161, 1, 161, 1, 1, 1, 161, 160, 162, 168, 155, 153, 1, 1, 1, 1, 1, 1, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 172, Line truncated
exports.labelText = "orgmilcomschnetedugovdrrformsfeedbackofficialaccoorgmilschnetgovmagazinemediaunioncargopilotgroupcaarespressworksaerodromeworkinggroupair-traffic-controlaircraftaccident-preventioneducatormarketplaceambulanceinsurancecateringairportrepbodyenginesoftwaremodellingair-surveillanceconsultingchartertrainermaintenanceservicesdesignflightskydivingfreightassociationstudentgroundhandlingdgcafuelclubtaxicrewshowballooningexpresstraderbrokerauthoragentsairtrafficjournalistsafetyconsultantmicrolightaccident-investigationparachutingequipmentproductionfederationrecreationscientistnavigationengineertradingglidingleasingresearchpassenger-associationentertainmentparaglidinghangglidingaerobaticrotorcraftemergencycertificationgovernmentaeroclubexchangelogisticschampionshiphomebuiltcouncilconferencecontrolairlinecivilaviationjournalorgcomnetedugovcoorgcomnomnetobjofforgcomnetuwukiloappsframerorgmilcomnetedugovcoradioorgcomnetcommuneedogpbcoitgvorgedugov*spreviewfrontendrelayononstagingupid*mtls*privatelinktypedreamdeveloperbravemochawindsurfaivenmirenupsunwnextbegetngrokclerkwale2bwebcsbrunputerflutterflowspawnbaseshiptodaymagicpatternsnetlifyondigitaloceanrailwayhostedclaudehasurabotdashvercelgithubluyanigadgetreplitcloudflaretelebitedgecomputeevervaultexponyatnoopencrpplxzeaburwasmerframerzeropsrocketpreviewconvexmedusajsspritesonherculeseasypanelstreamlitsnowflakemesserliloginlinehackclubcodepennorthflankbase44corespeedleapcellngrok-freeclerkstagelovableon-fleek*us-west-3ap-south-2us-central-2us-central-1eu-central-1ap-south-1us-west-2us-east-2eu-north-1ap-north-1us-west-1us-east-1*rcloudintsegorgmilcomgobbetnetintedugovturmusicasenasamutualcoopip6uriurnin-addre164homeirisgovdixdaemoncloudnssthwien*inexexkunden4accogvormymyspreadshop4lima2ixortsinfofuturecmsfuturehosting12hpprivfuturemailinglima-cityfunkfeuer123webseitednshomemelmyspreadshopcloudletswasantqldvicactnswtascatholicwasaqldvictasidwasantozqldorgcomvicasnactnetedugovnswtasconfcomairflowlambda-urltransfer-webappairflowtransfer-webapptransfer-webapptransfer-webapp-fipstransfer-webappeu-west-3ap-south-2eu-south-2eu-central-2ap-southeast-3ap-southeast-4ap-northeast-3eu-central-1mx-central-1me-central-1ca-central-1il-central-1ap-northeast-1ap-southeast-1me-south-1af-south-1eu-south-1ap-south-1ap-southeast-7us-west-2eu-west-2us-east-2eu-north-1ap-southeast-2ap-northeast-2ap-southeast-5us-gov-west-1us-gov-east-1ca-west-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1privatenotebookstudiolabelingnotebookstudionotebooknotebook-fipslabelingnotebookstudionotebook-fipsnotebookstudio-fipsnotebook-fipsnotebookstudionotebook-fipsnotebookstudioeu-west-3ap-south-2eu-south-2eu-central-2ap-southeast-3ap-southeast-4ap-northeast-3eu-central-1me-central-1ca-central-1il-central-1ap-northeast-1ap-southeast-1me-south-1af-south-1eu-south-1ap-south-1us-west-2eu-west-2us-east-2eu-north-1ap-southeast-2ap-northeast-2experimentsus-gov-west-1us-gov-east-1ca-west-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1onrepostsagemakercopporgmilcompronetintedugovbiznameinfoshoprsorgmilcomnetedugovbrendlyresolvenzauscotvstoreorgcomnetedugovbizinfoidacaicoittvorgmilcomschnetedugovinfocloudezproxyacmymyspreadshopkuleuvenwebhostingtransurl123websitecloudnsinterhostsolutionsddns5476103298edgfacbmlonihkjutwvqpsryxzbarsycoororgcomedumyftpno-iporxcloud-ipfor-somemmafanfor-morewebhopselfipjozidyndnscloudnsdscloudfor-thefor-betteractivetrailcoeconorestooteorgcomeconeteduassurmoneyafricaarchitectesrestaurantloisirstourismavocatsinfoagrounivcoorgcomnetedugoviatvdeportesaludtksatorgmilcomwebgobnetinteducienciaboliviarevistacooperativaempresanombreindustriamusicapatriamedicinademocraciapoliticapuebloindigenaplurinacionalarteblogwikiinfoagrotransportenoticiasprofesionalacademiaeconomiaecologiamovimientotecnologianaturalsimplesitecepesebamapadfmgalampbacscpirngorotomtrjspaprrprrsesmscepesebamapadfmgalampbacscpirngorotomtrjspaprrprrsesms*biaamfmtcmptvfeirasampajampanatalbelemananiradiog12medindfndbmdtrdthepoaggfjdfdefinfenflegsegongengcngorgzlgslglogppgmillelqslcimcomnomadmjabimbbibbsbabcrectecsjcetcpscpvhudieticriapipsiecnbiorioecogeoteoodoproatoartfstmatvetdetbetnetcntnotfotgrueduajuespappreptmpemparqsrvadvdevgovntrturagrjorfarjusmusdesvixxyzcozfozslzbhzmaringasantamariacampinagrandegoianiasorocabafloripasaobernardocuritibaboavistarecifeaparecidasaogoncasalvadorcuiabamorenamacapalondrinacontagemsocialfortalmaceioleilaoosascoriobranconiteroi9guacutcheblogflogvlogwikitaxicoopmanauspalmascaxiasjoinvillebaruericampinassantoandreribeiraoriopretoweorgcomnetedugovv0windsurfshiptodaycloudsitecoaccoorgnetgovofmilcomgovmediatechzacoorgcomnetedugsjgovmydnspenfnlabnbmbgcbcqconcontnuyksknsmyspreadshopno-ipawdevboxbarsyonidatemfuinabusavinstanceseceuguukussryzespawncsxcloud-ipmyphotosfantasyleaguetwmailcleverappsscrappingccwucloudnsftpaccessgame-serverccgovobjectsrmalpgcust*svcalp1aeappenginermalpgmyspreadshop4lima2ixsquare7cloudscale123websitefirenet12hpflowgotdnslinkyard-cloudcloudnslima-citydnskingobjectstorageLine truncated
exports.rulesRoot = 620;
exports.exceptionsRoot = 624;
//# sourceMappingURL=trie.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"trie.js","sourceRoot":"","sources":["../../../../src/data/trie.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AAC1C,QAAA,SAAS,GAAiB,IAAI,UAAU,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC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intentionally) near-identical to packages/tldts-icann/src/suffix-trie.ts.
// They are separate copies rather than a shared helper because the lookup is
// only fast when the typed arrays are module-scope monomorphic globals —
// closing over them (a shared factory) measured ~20% slower. The ICANN build
// also specializes (constant mask, no isIcann/isPrivate). Keep the two in sync.
const tldts_core_1 = require("tldts-core");
const trie_1 = require("./data/trie");
// `edgeOffset` (where each label starts in `labelText`), `edgeHash` (djb2 of
// each label) and `wildcardEdge` (each node's '*' edge, or -1) are derived once
// at load instead of being shipped: the bundle then carries only the
// compressible `labelText` + structure, while the lookup binary-searches
// integer hashes. The cost is a single ~1ms pass at first import — cheaper than
// the object trie it replaces. Kept at module scope (not captured in a closure)
// so V8 treats the typed arrays as fast monomorphic globals.
const numberOfNodes = trie_1.nodeFlags.length;
const numberOfEdges = trie_1.edgeLength.length;
const edgeOffset = new Uint32Array(numberOfEdges);
const edgeHash = new Uint32Array(numberOfEdges);
const wildcardEdge = new Int32Array(numberOfNodes).fill(-1);
for (let node = 0, offset = 0; node < numberOfNodes; node += 1) {
for (let edge = trie_1.edgeStart[node]; edge < trie_1.edgeStart[node + 1]; edge += 1) {
edgeOffset[edge] = offset;
const end = offset + trie_1.edgeLength[edge];
let hash = 5381;
for (let i = end - 1; i >= offset; i -= 1) {
hash = (hash * 33) ^ trie_1.labelText.charCodeAt(i);
}
edgeHash[edge] = hash >>> 0;
if (trie_1.edgeLength[edge] === 1 &&
trie_1.labelText.charCodeAt(offset) === 42 /* '*' */) {
wildcardEdge[node] = edge;
}
offset = end;
}
}
// Result of the last `walk`, kept in module scope to avoid allocating a match
// object. Safe because lookups are synchronous and read right after `walk`.
let matchNode = -1;
let matchStart = 0;
let matchEnd = 0;
/**
* True if edge `edge`'s label equals `hostname[start, start + length)`.
*/
function labelEquals(edge, hostname, start, length) {
if (trie_1.edgeLength[edge] !== length) {
return false;
}
const offset = edgeOffset[edge];
for (let i = 0; i < length; i += 1) {
if (trie_1.labelText.charCodeAt(offset + i) !== hostname.charCodeAt(start + i)) {
return false;
}
}
return true;
}
/**
* Find the child edge of `node` whose label is `hostname[start, start + length)`.
* Edges are sorted by hash, so binary-search the hash then verify the label
* (scanning the rare run of equal hashes). Returns the edge index or -1.
*/
function findEdge(node, hash, hostname, start, length) {
let lo = trie_1.edgeStart[node];
let hi = trie_1.edgeStart[node + 1];
while (lo < hi) {
const mid = (lo + hi) >>> 1;
const value = edgeHash[mid];
if (value < hash) {
lo = mid + 1;
}
else if (value > hash) {
hi = mid;
}
else {
for (let e = mid; e >= lo && edgeHash[e] === hash; e -= 1) {
if (labelEquals(e, hostname, start, length))
return e;
}
for (let e = mid + 1; e < hi && edgeHash[e] === hash; e += 1) {
if (labelEquals(e, hostname, start, length))
return e;
}
return -1;
}
}
return -1;
}
/**
* Walk `hostname`'s labels right-to-left from `root`, recording the deepest
* node whose flag passes `allowedMask` (with the label boundaries of that match
* in `matchStart`/`matchEnd`). Returns whether any match was found.
*/
function walk(hostname, root, allowedMask) {
let node = root;
let end = hostname.length;
let hash = 5381;
matchNode = -1;
for (let i = hostname.length - 1; i >= 0; i -= 1) {
const code = hostname.charCodeAt(i);
if (code === 46 /* '.' */) {
const start = i + 1;
let edge = findEdge(node, hash >>> 0, hostname, start, end - start);
if (edge === -1) {
edge = wildcardEdge[node];
}
if (edge === -1) {
return matchNode !== -1;
}
node = trie_1.edgeChild[edge];
if ((trie_1.nodeFlags[node] & allowedMask) !== 0) {
matchNode = node;
matchStart = start;
matchEnd = end;
}
end = i;
hash = 5381;
}
else {
hash = (hash * 33) ^ code;
}
}
// Left-most label: hostname[0, end). Same find/descend/record as the loop —
// duplicated rather than folded into the loop (via `i >= -1`) because that
// extra per-character branch measured slightly slower on the hot path.
let edge = findEdge(node, hash >>> 0, hostname, 0, end);
if (edge === -1) {
edge = wildcardEdge[node];
}
if (edge !== -1) {
node = trie_1.edgeChild[edge];
if ((trie_1.nodeFlags[node] & allowedMask) !== 0) {
matchNode = node;
matchStart = 0;
matchEnd = end;
}
}
return matchNode !== -1;
}
/**
* Check if `hostname` has a valid public suffix in the trie.
*/
function suffixLookup(hostname, options, out) {
if ((0, tldts_core_1.fastPathLookup)(hostname, options, out)) {
return;
}
const allowedMask = (options.allowPrivateDomains ? 2 /* RULE_TYPE.PRIVATE */ : 0) |
(options.allowIcannDomains ? 1 /* RULE_TYPE.ICANN */ : 0);
// Exceptions have priority and strip their own left-most label (e.g. the
// rule '!www.ck' makes the suffix of 'www.ck' be 'ck').
if (walk(hostname, trie_1.exceptionsRoot, allowedMask)) {
out.isIcann = (trie_1.nodeFlags[matchNode] & 1 /* RULE_TYPE.ICANN */) !== 0;
out.isPrivate = (trie_1.nodeFlags[matchNode] & 2 /* RULE_TYPE.PRIVATE */) !== 0;
out.publicSuffix = hostname.slice(matchEnd + 1);
return;
}
if (walk(hostname, trie_1.rulesRoot, allowedMask)) {
out.isIcann = (trie_1.nodeFlags[matchNode] & 1 /* RULE_TYPE.ICANN */) !== 0;
out.isPrivate = (trie_1.nodeFlags[matchNode] & 2 /* RULE_TYPE.PRIVATE */) !== 0;
out.publicSuffix = hostname.slice(matchStart);
return;
}
// No match: the prevailing '*' rule makes the right-most label the suffix.
out.isIcann = false;
out.isPrivate = false;
const lastDot = hostname.lastIndexOf('.');
out.publicSuffix = lastDot === -1 ? hostname : hostname.slice(lastDot + 1);
}
//# sourceMappingURL=suffix-trie.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"suffix-trie.js","sourceRoot":"","sources":["../../../src/suffix-trie.ts"],"names":[],"mappings":";;AA4KA,+BAkCC;AA9MD,wFAAwF;AACxF,6EAA6E;AAC7E,yEAAyE;AACzE,6EAA6E;AAC7E,gFAAgF;AAChF,2CAIoB;AACpB,sCAQqB;AAOrB,6EAA6E;AAC7E,gFAAgF;AAChF,qEAAqE;AACrE,yEAAyE;AACzE,gFAAgF;AAChF,gFAAgF;AAChF,6DAA6D;AAC7D,MAAM,aAAa,GAAG,gBAAS,CAAC,MAAM,CAAC;AACvC,MAAM,aAAa,GAAG,iBAA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AAC1B,CAAC;AAED;;GAEG;AACH,SAAwB,YAAY,CAClC,QAAgB,EAChB,OAA6B,EAC7B,GAAkB;IAElB,IAAI,IAAA,2BAAc,EAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,CAAC;QAC3C,OAAO;IACT,CAAC;IAED,MAAM,WAAW,GACf,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,2BAAmB,CAAC,CAAC,CAAC,CAAC;QACrD,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,yBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;IAEpD,yEAAyE;IACzE,wDAAwD;IACxD,IAAI,IAAI,CAAC,QAAQ,EAAE,qBAAc,EAAE,WAAW,CAAC,EAAE,CAAC;QAChD,GAAG,CAAC,OAAO,GAAG,CAAC,gBAAS,CAAC,SAAS,CAAE,0BAAkB,CLine truncated
+1
View File
@@ -0,0 +1 @@
{"fileNames":["../../../../node_modules/typescript/lib/lib.es5.d.ts","../../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../../node_modules/typescript/lib/lib.dom.d.ts","../../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../../node_modules/typescript/lib/lib.scripthost.d.ts","../../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../../../node_modules/typescript/lib/lib.esnext.float16.d.ts","../../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../../node_modules/typescript/lib/lib.es2017.full.d.ts","../../../tldts-core/dist/types/src/lookup/interface.d.ts","../../../tldts-core/dist/types/src/options.d.ts","../../../tldts-core/dist/types/src/factory.d.ts","../../../tldts-core/dist/types/src/lookup/fast-path.d.ts","../../../tldts-core/dist/types/index.d.ts","../../src/data/trie.ts","../../src/suffix-trie.ts","../../index.ts","../../../../node_modules/@types/deep-eql/index.d.ts","../../../../node_modules/assertion-error/index.d.ts","../../../../node_modules/@types/chai/index.d.ts","../../../../node_modules/@types/command-line-args/index.d.ts","../../../../node_modules/@types/command-line-usage/index.d.ts","../../../../node_modules/@types/estree/index.d.ts","../../../../node_modules/@types/json-schema/index.d.ts","../../../../node_modules/@types/mocha/index.d.ts","../../../../node_modules/@types/node/globals.typedarray.d.ts","../../../../node_modules/@types/node/buffer.buffer.d.ts","../../../../node_modules/@types/node/globals.d.ts","../../../../node_modules/@types/node/web-globals/abortcontroller.d.ts","../../../../node_modules/@types/node/web-globals/blob.d.ts","../../../../node_modules/@types/node/web-globals/console.d.ts","../../../../node_modules/@types/node/web-globals/crypto.d.ts","../../../../node_modules/@types/node/web-globals/domexception.d.ts","../../../../node_modules/@types/node/web-globals/encoding.d.ts","../../../../node_modules/@types/node/web-globals/events.d.ts","../../../../node_modules/undici-types/utility.d.ts","../../../../node_modules/undici-types/header.d.ts","../../../../node_modules/undici-types/readable.d.ts","../../../../node_modules/undici-Line truncated
+41
View File
@@ -0,0 +1,41 @@
import { getEmptyResult, parseImpl, resetResult, } from 'tldts-core';
import suffixLookup from './src/suffix-trie';
// For all methods but 'parse', it does not make sense to allocate an object
// every single time to only return the value of a specific attribute. To avoid
// this un-necessary allocation, we use a global object which is re-used.
const RESULT = getEmptyResult();
export function parse(url, options) {
return parseImpl(url, 5 /* FLAG.ALL */, suffixLookup, options, getEmptyResult());
}
export function getHostname(url, options) {
/*@__INLINE__*/ resetResult(RESULT);
return parseImpl(url, 0 /* FLAG.HOSTNAME */, suffixLookup, options, RESULT).hostname;
}
export function getPublicSuffix(url, options) {
/*@__INLINE__*/ resetResult(RESULT);
return parseImpl(url, 2 /* FLAG.PUBLIC_SUFFIX */, suffixLookup, options, RESULT)
.publicSuffix;
}
export function getDomain(url, options) {
/*@__INLINE__*/ resetResult(RESULT);
return parseImpl(url, 3 /* FLAG.DOMAIN */, suffixLookup, options, RESULT).domain;
}
export function getFullDomain(url, options) {
/*@__INLINE__*/ resetResult(RESULT);
const result = parseImpl(url, 3 /* FLAG.DOMAIN */, suffixLookup, options, RESULT);
// The hostname *is* the full domain (subdomain + domain) whenever a
// registrable domain exists; gate on `domain` so non-registrable inputs
// (IPs, suffix-less or invalid hostnames) return `null` like `getDomain`.
return result.domain === null ? null : result.hostname;
}
export function getSubdomain(url, options) {
/*@__INLINE__*/ resetResult(RESULT);
return parseImpl(url, 4 /* FLAG.SUB_DOMAIN */, suffixLookup, options, RESULT)
.subdomain;
}
export function getDomainWithoutSuffix(url, options) {
/*@__INLINE__*/ resetResult(RESULT);
return parseImpl(url, 5 /* FLAG.ALL */, suffixLookup, options, RESULT)
.domainWithoutSuffix;
}
//# sourceMappingURL=index.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EAGd,SAAS,EACT,WAAW,GACZ,MAAM,YAAY,CAAC;AAEpB,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAE7C,4EAA4E;AAC5E,+EAA+E;AAC/E,yEAAyE;AACzE,MAAM,MAAM,GAAY,cAAc,EAAE,CAAC;AAEzC,MAAM,UAAU,KAAK,CAAC,GAAW,EAAE,OAA2B;IAC5D,OAAO,SAAS,CAAC,GAAG,oBAAY,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,CAAC;AAC3E,CAAC;AAED,MAAM,UAAU,WAAW,CACzB,GAAW,EACX,OAA2B;IAE3B,eAAe,CAAC,WAAW,CAA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106, 111, 117, 124, 130, 136, 145, 146, 147, 148, 149, 150, 151, 153, 154, 155, 157, 159, 226, 239, 241, 242, 243, 258, 265, 266, 269, 270, 271, 274, 276, 295, 296, 298, 307, 312, 329, 330, 333, 335, 336, 338, 372, 373, 375, 378, 379, 383, 385, 389, 392, 424, 427, 440, 441, 449, 450, 452, 462, 476, 477, 478, 487, 488, 525, 530, 546, 566, 572, 614, 615, 642, 669, 670, 818, 824, 827, 828, 829, 834, 839, 848, 870, 871, 872, 873, 874, 875, 876, 894, 896, 897, 900, 902, 903, 905, 907, 922, 937, 942, 943, 945, 946, 947, 948, 949, 951, 954, 959, 960, 961, 963, 964, 967, 970, 971, 972, 985, 987, 999, 1010, 1018, 1020, 1061, 1064, 1068, 1069, 1071, 1074, 1085, 1087, 1097, 1099, 1105, 1107, 1108, 1110, 1113, 1114, 1115, 1168, 1170, 1172, 1192, 1193, 1194, 1195, 1197, 1208, 1239, 1250, 1262, 1271, 1278, 1283, 1296, 1307, 1320, 1321, 1332, 1366, 1367, 1368, 1383, 1398, 1470, 1471, 1473, 1474, 1508, 1509, 1510, 1511, 1514, 1518, 1520, 1549, 1550, 1558, 1559, 1560, 1562, 1564, 1565, 1567, 1568, 1569, 1580, 1581, 1582, 1583, 1584, 1585, 1586, 1587, 1588, 1589, 1590, 1591, 1592, 1593, 1595, 1596, 1597, 2051, 2054, 2055, 2057, 2064, 2071, 2081, 2085, 2096, 2097, 2098, 2110, 2111, 2113, 2115, 2116, 2123, 2124, 2126, 2127, 2129, 2130, 2131, 2132, 2133, 2207, 2209, 2230, 2231, 2232, 2234, 2260, 2261, 2312, 2313, 2315, 2322, 2328, 2338, 2348, 2401, 2402, 2403, 2413, 2427, 2428, 2431, 2438, 2439, 2447, 2448, 2449, 2450, 2451, 2462, 2463, 2464, 2466, 2467, 2468, 2477, 2489, 2495, 2527, 2531, 2533, 2534, 2536, 2537, 2548, 2549, 2551, 2559, 2566, 2572, 2577, 2578, 2584, 2587, 2593, 2600, 2601, 2608, 2616, 2617, 2618, 2656, 2662, 2677, 2678, 2683, 2701, 2732, 2750, 2752, 2755, 2763, 2765, 2772, 2824, 2848, 2849, 2850, 2851, 2852, 2853, 2854, 2861, 2862, 2863, 2864, 2865, 2866, 2868, 2869, 2873, 2953, 2966, 2967, 3404, 3408, 3422, 3474, 3502, 3524, 3582, 3604, 3619, 3682, 3733, 3771, 3807, 3832, 3974, 4020, 4071, 4090, 4124, 4139, 4159, 4189, 4220, 4243, 4274, 4304, 4336, 4363, 4438, 4460, 4498, 4508, 4542, 4561, 4587, 4629, 4679, 4705, 4774, 4775, 4777, 4800, 4823, 4859, 4890, 4907, 4964, 4977, 5001, 5030, 5032, 5066, 5082, 5110, 5415, 5424, 5433, 5440, 5457, 5461, 5467, 5506, 5508, 5515, 5522, 5531, 5538, 5539, 5540, 5552, 5555, 5570, 5571, 5580, 5581, 5590, 5599, 5605, 5607, 5608, 5609, 5646, 5647, 5649, 5657, 5664, 5677, 5681, 5683, 5684, 5690, 5697, 5711, 5721, 5726, 5734, 5742, 5748, 5749, 5753, 5755, 5756, 5768, 5840, 5841, 5842, 5843, 5845, 5846, 5849, 5851, 5854, 5858, 5859, 5860, 5866, 5867, 5868, 5870, 5872, 5874, 5875, 5876, 5879, 5881, 5884, 5885, 5887, 6085, 6092, 6093, 6094, 6104, 6109, 6126, 6140, 6149, 6150, 6151, 6155, 6156, 6158, 6160, 6166, 6167, 6170, 6171, 6173, 6174, 6175, 7075, 7078, 7082, 7100, 7109, 7112, 7119, 7120, 7122, 7123, 7124, 7126, 7178, 7179, 7182, 7183, 7300, 7301, 7312, 7323, 7330, 7333, 7342, 7343, 7344, 7359, 7414, 7605, 7607, 7608, 7610, 7615, 7628, 7643, 7650, 7659, 7662, 7665, 7672, 7680, 7684, 7685, 7686, 7700, 7704, 7713, 7714, 7715, 7719, 7754, 7755, 7772, 7779, 7787, 7788, 7793, 7801, 7845, 7846, 7852, 7855, 7866, 7871, 7872, 7875, 7877, 7912, 7913, 7919, 7926, 7927, 7936, 7945, 7960, 7964, 8016, 8017, 8022, 8024, 8027, 8029, 8030, 8031, 8040, 8054, 8062, 8076, 8088, 8089, 8091, 8093, 8115, 8126, 8132, 8133, 8145, 8157, 8244, 8256, 8264, 8267, 8273, 8298, 8301, 8302, 8303, 8305, 8308, 8311, 8322, 8324, 8326, 8354, 8428, 8435, 8439, 8440, 8449, 8471, 8472, 8477, 8478, 8557, 8559, 8561, 8570, 8574, 8580, 8586, 8592, 8602, 8607, 8608, 8626, 8637, 8642, 8647, 8657, 8663, 8667, 8673, 8679, 10288, 10289, 10290, 10297, 10299]);
export const edgeLength = /*#__PURE__*/ new Uint8Array([3, 3, 3, 3, 3, 3, 3, 3, 5, 8, 8, 2, 2, 3, 3, 3, 3, 3, 8, 5, 5, 5, 5, 5, 3, 3, 5, 5, 9, 12, 19, 8, 19, 8, 11, 9, 9, 8, 7, 7, 6, 8, 9, 16, 10, 7, 7, 11, 8, 6, 6, 9, 7, 11, 7, 14, 4, 4, 4, 4, 4, 4, 10, 7, 6, 6, 6, 6, 10, 10, 6, 10, 10, 22, 11, 9, 10, 10, 10, 9, 10, 8, 7, 7, 7, 8, 21, 13, 11, 11, 9, 10, 9, 13, 10, 8, 8, 9, 12, 9, 7, 10, 7, 7, 13, 7, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 8, 6, 3, 3, 3, 3, 3, 3, 2, 5, 3, 3, 3, 7, 2, 2, 2, 2, 2, 2, 3, 3, 3, 1, 1, 7, 8, 5, 2, 2, 7, 2, 2, 1, 4, 1, 11, 9, 9, 5, 5, 8, 5, 5, 5, 5, 5, 5, 5, 3, 3, 3, 3, 3, 5, 11, 9, 9, 13, 7, 14, 7, 6, 6, 6, 7, 6, 6, 6, 6, 6, 10, 7, 11, 9, 4, 4, 4, 4, 4, 6, 6, 6, 6, 13, 6, 8, 7, 10, 9, 9, 9, 8, 9, 8, 7, 10, 6, 9, 8, 10, 10, 7, 8, 1, 9, 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9, 17, 13, 10, 10, 14, 16, 17, 11, 6, 2, 14, 9, 13, 10, 14, 16, 17, 11, 2, 14, 9, 13, 10, 16, 11, 2, 14, 10, 19, 7, 2, 14, 9, 13, 10, 19, 10, 7, 14, 16, 17, 11, 6, 2, 14, 9, 13, 10, 19, 7, 14, 16, 17, 11, 2, 14, 9, 13, 17, 13, 10, 10, 14, 16, 17, 11, 6, 3, 2, 14, 9, 13, 10, 10, 14, 16, 17, 11, 6, 9, 10, 12, 14, 14, 14, 12, 12, 12, 12, 12, 14, 14, 14, 10, 10, 10, 14, 9, 9, 9, 9, 14, 14, 14, 13, 13, 14, 9, 9, 9, 9, 9, 9, 4, 11, 2, 14, 9, 13, 17, 13, 10, 19, 10, 7, 14, 16, 17, 11, 6, 2, 14, 9, 13, 17, 13, 10, 19, 10, 7, 14, 16, 17, 11, 6, 2, 9, 10, 10, 7, 17, 3, 3, 12, 12, 16, 15, 15, 12, 14, 14, 14, 20, 20, 13, 12, 12, 12, 12, 12, 12, 20, 25, 14, 14, 12, 12, 10, 10, 10, 10, 9, 9, 9, 25, 4, 9, 17, 10, 7, 14, 16, 21, 13, 13, 14, 20, 14, 13, 17, 24, 9, 12, 13, 25, 13, 21, 20, 17, 9, 9, 9, 9, 9, 9, 12, 17, 4, 4, 9, 9, 9, 10, 10, 12, 14, 14, 14, 12, 12, 12, 12, 12, 14, 14, 10, 10, 10, 10, 14, 9, 9, 9, 10, 14, 14, 14, 13, 13, 9, 9, 9, 9, 9, 9, 1, 5, 8Line truncated
export const edgeChild = /*#__PURE__*/ new Uint16Array([0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 12, 1, 1, 1, 1, 1, 17, 1, 1, 1, 12, 1, 12, 1, 12, 13, 1, 1, 1, 1, 12, 1, 12, 1, 1, 1, 1, 1, 14, 21, 1, 1, 1, 1, 1, 1, 1, 19, 12, 1, 1, 1, 1, 1, 1, 1, 20, 1, 1, 1, 16, 18, 1, 1, 15, 1, 1, 1, 1, 12, 1, 1, 1, 1, 1, 1, 1, 22, 1, 1, 1, 1, 12, 1, 1, 1, 1, 1, 1, 1, 1, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 1, 24, 25, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 12, 12, 12, 12, 1, 32, 0, 0, 0, 1, 1, 1, 1, 35, 34, 1, 1, 1, 1, 1, 33, 1, 1, 1, 1, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 38, 0, 0, 0, 0, 39, 40, 0, 0, 0, 0, 12, 1, 1, 12, 1, 1, 1, 1, 43, 44, 44, 44, 43, 44, 43, 43, 45, 44, 43, 44, 43, 43, 43, 43, 43, 43, 45, 43, 43, 43, 43, 43, 43, 44, 46, 46, 44, 43, 43, 43, 43, 43, 12, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 49, 51, 49, 49, 49, 51, 49, 50, 49, 52, 49, 50, 50, 49, 49, 49, 50, 52, 50, 52, 49, 50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1, 1, 1, 136, 137, 12, 12, 134, 132, 44, 44, 139, 49, 49, 138, 141, 140, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 144, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 142, 0, 0, 0, 0, 1, 0, 143, 131, 1, 0, 1, 1, 12, 12, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 147, 146, 20, 1, 1, 12, 12, 1, 20, 12, 12, 1, 1, 1, 1, 1, 133, 1, 1, 151, 1, 1, 1, 1, 152, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 1, 1, 135, 1, 1, 151, 1, 1, 1, 1, 152, 1, 1, 133, 1, 1, 1, 151, 1, 1, 1, 1, 152, 1, 1, 133, 1, 1, 1, 1, 1, 1, 1, 1, 133, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 159, 1, 1, 1, 151, 1, 1, 1, 1, 1, 152, 1, 1, 159, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 133, 1, 1, 1, 1, 151, 1, 1, 1, 1, 152, 1, 1, 1, 133, 1, 1, 151, 1, 1, 1, 1, 163, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 1, 166, 1, 1, 159, 1, 1, 1, 1, 1, 151, 1, 1, 1, 1, 1, 152, 1, 1, 159, 1, 1, 1, 1, 1, 151, 1, 1, 1, 1, 1, 152, 1, 153, 157, 157, 12, 1, 12, 165, 1, 1, 1, 1, 1, 157, 157, 157, 153, 1, 1, 1, 156, 157, 160, 164, 1, 1, 1, 1, 156, 156, 1, 1, 155, 153, 153, 156, 169, 155, 169, 1, 1, 167, 1, 155, 154, 156, 1, 1, 1, 1, 156, 1, 158, 1, 1, 1, 12, 1, 161, 1, 161, 1, 1, 1, 161, 160, 162, 168, 155, 153, 1, 1, 1, 1, 1, 1, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 1Line truncated
export const labelText = "orgmilcomschnetedugovdrrformsfeedbackofficialaccoorgmilschnetgovmagazinemediaunioncargopilotgroupcaarespressworksaerodromeworkinggroupair-traffic-controlaircraftaccident-preventioneducatormarketplaceambulanceinsurancecateringairportrepbodyenginesoftwaremodellingair-surveillanceconsultingchartertrainermaintenanceservicesdesignflightskydivingfreightassociationstudentgroundhandlingdgcafuelclubtaxicrewshowballooningexpresstraderbrokerauthoragentsairtrafficjournalistsafetyconsultantmicrolightaccident-investigationparachutingequipmentproductionfederationrecreationscientistnavigationengineertradingglidingleasingresearchpassenger-associationentertainmentparaglidinghangglidingaerobaticrotorcraftemergencycertificationgovernmentaeroclubexchangelogisticschampionshiphomebuiltcouncilconferencecontrolairlinecivilaviationjournalorgcomnetedugovcoorgcomnomnetobjofforgcomnetuwukiloappsframerorgmilcomnetedugovcoradioorgcomnetcommuneedogpbcoitgvorgedugov*spreviewfrontendrelayononstagingupid*mtls*privatelinktypedreamdeveloperbravemochawindsurfaivenmirenupsunwnextbegetngrokclerkwale2bwebcsbrunputerflutterflowspawnbaseshiptodaymagicpatternsnetlifyondigitaloceanrailwayhostedclaudehasurabotdashvercelgithubluyanigadgetreplitcloudflaretelebitedgecomputeevervaultexponyatnoopencrpplxzeaburwasmerframerzeropsrocketpreviewconvexmedusajsspritesonherculeseasypanelstreamlitsnowflakemesserliloginlinehackclubcodepennorthflankbase44corespeedleapcellngrok-freeclerkstagelovableon-fleek*us-west-3ap-south-2us-central-2us-central-1eu-central-1ap-south-1us-west-2us-east-2eu-north-1ap-north-1us-west-1us-east-1*rcloudintsegorgmilcomgobbetnetintedugovturmusicasenasamutualcoopip6uriurnin-addre164homeirisgovdixdaemoncloudnssthwien*inexexkunden4accogvormymyspreadshop4lima2ixortsinfofuturecmsfuturehosting12hpprivfuturemailinglima-cityfunkfeuer123webseitednshomemelmyspreadshopcloudletswasantqldvicactnswtascatholicwasaqldvictasidwasantozqldorgcomvicasnactnetedugovnswtasconfcomairflowlambda-urltransfer-webappairflowtransfer-webapptransfer-webapptransfer-webapp-fipstransfer-webappeu-west-3ap-south-2eu-south-2eu-central-2ap-southeast-3ap-southeast-4ap-northeast-3eu-central-1mx-central-1me-central-1ca-central-1il-central-1ap-northeast-1ap-southeast-1me-south-1af-south-1eu-south-1ap-south-1ap-southeast-7us-west-2eu-west-2us-east-2eu-north-1ap-southeast-2ap-northeast-2ap-southeast-5us-gov-west-1us-gov-east-1ca-west-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1privatenotebookstudiolabelingnotebookstudionotebooknotebook-fipslabelingnotebookstudionotebook-fipsnotebookstudio-fipsnotebook-fipsnotebookstudionotebook-fipsnotebookstudioeu-west-3ap-south-2eu-south-2eu-central-2ap-southeast-3ap-southeast-4ap-northeast-3eu-central-1me-central-1ca-central-1il-central-1ap-northeast-1ap-southeast-1me-south-1af-south-1eu-south-1ap-south-1us-west-2eu-west-2us-east-2eu-north-1ap-southeast-2ap-northeast-2experimentsus-gov-west-1us-gov-east-1ca-west-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1onrepostsagemakercopporgmilcompronetintedugovbiznameinfoshoprsorgmilcomnetedugovbrendlyresolvenzauscotvstoreorgcomnetedugovbizinfoidacaicoittvorgmilcomschnetedugovinfocloudezproxyacmymyspreadshopkuleuvenwebhostingtransurl123websitecloudnsinterhostsolutionsddns5476103298edgfacbmlonihkjutwvqpsryxzbarsycoororgcomedumyftpno-iporxcloud-ipfor-somemmafanfor-morewebhopselfipjozidyndnscloudnsdscloudfor-thefor-betteractivetrailcoeconorestooteorgcomeconeteduassurmoneyafricaarchitectesrestaurantloisirstourismavocatsinfoagrounivcoorgcomnetedugoviatvdeportesaludtksatorgmilcomwebgobnetinteducienciaboliviarevistacooperativaempresanombreindustriamusicapatriamedicinademocraciapoliticapuebloindigenaplurinacionalarteblogwikiinfoagrotransportenoticiasprofesionalacademiaeconomiaecologiamovimientotecnologianaturalsimplesitecepesebamapadfmgalampbacscpirngorotomtrjspaprrprrsesmscepesebamapadfmgalampbacscpirngorotomtrjspaprrprrsesms*biaamfmtcmptvfeirasampajampanatalbelemananiradiog12medindfndbmdtrdthepoaggfjdfdefinfenflegsegongengcngorgzlgslglogppgmillelqslcimcomnomadmjabimbbibbsbabcrectecsjcetcpscpvhudieticriapipsiecnbiorioecogeoteoodoproatoartfstmatvetdetbetnetcntnotfotgrueduajuespappreptmpemparqsrvadvdevgovntrturagrjorfarjusmusdesvixxyzcozfozslzbhzmaringasantamariacampinagrandegoianiasorocabafloripasaobernardocuritibaboavistarecifeaparecidasaogoncasalvadorcuiabamorenamacapalondrinacontagemsocialfortalmaceioleilaoosascoriobranconiteroi9guacutcheblogflogvlogwikitaxicoopmanauspalmascaxiasjoinvillebaruericampinassantoandreribeiraoriopretoweorgcomnetedugovv0windsurfshiptodaycloudsitecoaccoorgnetgovofmilcomgovmediatechzacoorgcomnetedugsjgovmydnspenfnlabnbmbgcbcqconcontnuyksknsmyspreadshopno-ipawdevboxbarsyonidatemfuinabusavinstanceseceuguukussryzespawncsxcloud-ipmyphotosfantasyleaguetwmailcleverappsscrappingccwucloudnsftpaccessgame-serverccgovobjectsrmalpgcust*svcalp1aeappenginermalpgmyspreadshop4lima2ixsquare7cloudscale123websitefirenet12hpflowgotdnslinkyard-cloudcloudnslima-citydnskingobjectstLine truncated
export const rulesRoot = 620;
export const exceptionsRoot = 624;
//# sourceMappingURL=trie.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"trie.js","sourceRoot":"","sources":["../../../../src/data/trie.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,MAAM,CAAC,MAAM,SAAS,GAAG,aAAa,CAAC,IAAI,UAAU,CAAC,CAAC,C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AC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAACLine truncated
+167
View File
@@ -0,0 +1,167 @@
// NOTE: kept (intentionally) near-identical to packages/tldts-icann/src/suffix-trie.ts.
// They are separate copies rather than a shared helper because the lookup is
// only fast when the typed arrays are module-scope monomorphic globals —
// closing over them (a shared factory) measured ~20% slower. The ICANN build
// also specializes (constant mask, no isIcann/isPrivate). Keep the two in sync.
import { fastPathLookup, } from 'tldts-core';
import { edgeChild, edgeLength, edgeStart, exceptionsRoot, labelText, nodeFlags, rulesRoot, } from './data/trie';
// `edgeOffset` (where each label starts in `labelText`), `edgeHash` (djb2 of
// each label) and `wildcardEdge` (each node's '*' edge, or -1) are derived once
// at load instead of being shipped: the bundle then carries only the
// compressible `labelText` + structure, while the lookup binary-searches
// integer hashes. The cost is a single ~1ms pass at first import — cheaper than
// the object trie it replaces. Kept at module scope (not captured in a closure)
// so V8 treats the typed arrays as fast monomorphic globals.
const numberOfNodes = nodeFlags.length;
const numberOfEdges = edgeLength.length;
const edgeOffset = new Uint32Array(numberOfEdges);
const edgeHash = new Uint32Array(numberOfEdges);
const wildcardEdge = new Int32Array(numberOfNodes).fill(-1);
for (let node = 0, offset = 0; node < numberOfNodes; node += 1) {
for (let edge = edgeStart[node]; edge < edgeStart[node + 1]; edge += 1) {
edgeOffset[edge] = offset;
const end = offset + edgeLength[edge];
let hash = 5381;
for (let i = end - 1; i >= offset; i -= 1) {
hash = (hash * 33) ^ labelText.charCodeAt(i);
}
edgeHash[edge] = hash >>> 0;
if (edgeLength[edge] === 1 &&
labelText.charCodeAt(offset) === 42 /* '*' */) {
wildcardEdge[node] = edge;
}
offset = end;
}
}
// Result of the last `walk`, kept in module scope to avoid allocating a match
// object. Safe because lookups are synchronous and read right after `walk`.
let matchNode = -1;
let matchStart = 0;
let matchEnd = 0;
/**
* True if edge `edge`'s label equals `hostname[start, start + length)`.
*/
function labelEquals(edge, hostname, start, length) {
if (edgeLength[edge] !== length) {
return false;
}
const offset = edgeOffset[edge];
for (let i = 0; i < length; i += 1) {
if (labelText.charCodeAt(offset + i) !== hostname.charCodeAt(start + i)) {
return false;
}
}
return true;
}
/**
* Find the child edge of `node` whose label is `hostname[start, start + length)`.
* Edges are sorted by hash, so binary-search the hash then verify the label
* (scanning the rare run of equal hashes). Returns the edge index or -1.
*/
function findEdge(node, hash, hostname, start, length) {
let lo = edgeStart[node];
let hi = edgeStart[node + 1];
while (lo < hi) {
const mid = (lo + hi) >>> 1;
const value = edgeHash[mid];
if (value < hash) {
lo = mid + 1;
}
else if (value > hash) {
hi = mid;
}
else {
for (let e = mid; e >= lo && edgeHash[e] === hash; e -= 1) {
if (labelEquals(e, hostname, start, length))
return e;
}
for (let e = mid + 1; e < hi && edgeHash[e] === hash; e += 1) {
if (labelEquals(e, hostname, start, length))
return e;
}
return -1;
}
}
return -1;
}
/**
* Walk `hostname`'s labels right-to-left from `root`, recording the deepest
* node whose flag passes `allowedMask` (with the label boundaries of that match
* in `matchStart`/`matchEnd`). Returns whether any match was found.
*/
function walk(hostname, root, allowedMask) {
let node = root;
let end = hostname.length;
let hash = 5381;
matchNode = -1;
for (let i = hostname.length - 1; i >= 0; i -= 1) {
const code = hostname.charCodeAt(i);
if (code === 46 /* '.' */) {
const start = i + 1;
let edge = findEdge(node, hash >>> 0, hostname, start, end - start);
if (edge === -1) {
edge = wildcardEdge[node];
}
if (edge === -1) {
return matchNode !== -1;
}
node = edgeChild[edge];
if ((nodeFlags[node] & allowedMask) !== 0) {
matchNode = node;
matchStart = start;
matchEnd = end;
}
end = i;
hash = 5381;
}
else {
hash = (hash * 33) ^ code;
}
}
// Left-most label: hostname[0, end). Same find/descend/record as the loop —
// duplicated rather than folded into the loop (via `i >= -1`) because that
// extra per-character branch measured slightly slower on the hot path.
let edge = findEdge(node, hash >>> 0, hostname, 0, end);
if (edge === -1) {
edge = wildcardEdge[node];
}
if (edge !== -1) {
node = edgeChild[edge];
if ((nodeFlags[node] & allowedMask) !== 0) {
matchNode = node;
matchStart = 0;
matchEnd = end;
}
}
return matchNode !== -1;
}
/**
* Check if `hostname` has a valid public suffix in the trie.
*/
export default function suffixLookup(hostname, options, out) {
if (fastPathLookup(hostname, options, out)) {
return;
}
const allowedMask = (options.allowPrivateDomains ? 2 /* RULE_TYPE.PRIVATE */ : 0) |
(options.allowIcannDomains ? 1 /* RULE_TYPE.ICANN */ : 0);
// Exceptions have priority and strip their own left-most label (e.g. the
// rule '!www.ck' makes the suffix of 'www.ck' be 'ck').
if (walk(hostname, exceptionsRoot, allowedMask)) {
out.isIcann = (nodeFlags[matchNode] & 1 /* RULE_TYPE.ICANN */) !== 0;
out.isPrivate = (nodeFlags[matchNode] & 2 /* RULE_TYPE.PRIVATE */) !== 0;
out.publicSuffix = hostname.slice(matchEnd + 1);
return;
}
if (walk(hostname, rulesRoot, allowedMask)) {
out.isIcann = (nodeFlags[matchNode] & 1 /* RULE_TYPE.ICANN */) !== 0;
out.isPrivate = (nodeFlags[matchNode] & 2 /* RULE_TYPE.PRIVATE */) !== 0;
out.publicSuffix = hostname.slice(matchStart);
return;
}
// No match: the prevailing '*' rule makes the right-most label the suffix.
out.isIcann = false;
out.isPrivate = false;
const lastDot = hostname.lastIndexOf('.');
out.publicSuffix = lastDot === -1 ? hostname : hostname.slice(lastDot + 1);
}
//# sourceMappingURL=suffix-trie.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"suffix-trie.js","sourceRoot":"","sources":["../../../src/suffix-trie.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,6EAA6E;AAC7E,yEAAyE;AACzE,6EAA6E;AAC7E,gFAAgF;AAChF,OAAO,EACL,cAAc,GAGf,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,cAAc,EACd,SAAS,EACT,SAAS,EACT,SAAS,GACV,MAAM,aAAa,CAAC;AAOrB,6EAA6E;AAC7E,gFAAgF;AAChF,qEAAqE;AACrE,yEAAyE;AACzE,gFAAgF;AAChF,gFAAgF;AAChF,6DAA6D;AAC7D,MAAM,aAAa,GAAG,SAAS,CAAC,MAAM,CAAC;AACvC,MAAM,aAAa,GAAG,UAAU,CAAC,MAAM,CAAC;AACxC,MAAM,UAAU,GAAG,IAAI,WAAW,CAAC,aAAa,CAAC,CAAC;AAClD,MAAM,QAAQ,GAAG,IAAI,WAAW,CAAC,aAAa,CAAC,CAAC;AAChD,MAAM,YAAY,GAAG,IAAI,UAAU,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5D,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,IAAI,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,CAAC,yBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;IAEpD,yEAAyE;IACzE,wDAAwD;IACxD,IAAI,IAAI,CAAC,QAAQ,EAAELine truncated
+1
View File
@@ -0,0 +1 @@
{"fileNames":["../../../../node_modules/typescript/lib/lib.es5.d.ts","../../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../../node_modules/typescript/lib/lib.dom.d.ts","../../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../../../node_modules/typescript/lib/lib.scripthost.d.ts","../../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../../../node_modules/typescript/lib/lib.esnext.float16.d.ts","../../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../../node_modules/typescript/lib/lib.es2017.full.d.ts","../../../tldts-core/dist/types/src/lookup/interface.d.ts","../../../tldts-core/dist/types/src/options.d.ts","../../../tldts-core/dist/types/src/factory.d.ts","../../../tldts-core/dist/types/src/lookup/fast-path.d.ts","../../../tldts-core/dist/types/index.d.ts","../../src/data/trie.ts","../../src/suffix-trie.ts","../../index.ts","../../../../node_modules/@types/deep-eql/index.d.ts","../../../../node_modules/assertion-error/index.d.ts","../../../../node_modules/@types/chai/index.d.ts","../../../../node_modules/@types/command-line-args/index.d.ts","../../../../node_modules/@types/command-line-usage/index.d.ts","../../../../node_modules/@types/estree/index.d.ts","../../../../node_modules/@types/json-schema/index.d.ts","../../../../node_modules/@types/mocha/index.d.ts","../../../../node_modules/@types/node/globals.typedarray.d.ts","../../../../node_modules/@types/node/buffer.buffer.d.ts","../../../../node_modules/@types/node/globals.d.ts","../../../../node_modules/@types/node/web-globals/abortcontroller.d.ts","../../../../node_modules/@types/node/web-globals/blob.d.ts","../../../../node_modules/@types/node/web-globals/console.d.ts","../../../../node_modules/@types/node/web-globals/crypto.d.ts","../../../../node_modules/@types/node/web-globals/domexception.d.ts","../../../../node_modules/@types/node/web-globals/encoding.d.ts","../../../../node_modules/@types/node/web-globals/events.d.ts","../../../../node_modules/undici-types/utility.d.ts","../../../../node_modules/undici-types/header.d.ts","../../../../node_modules/undici-types/readable.d.ts","../../../../node_modules/undici-Line truncated
+2
View File
@@ -0,0 +1,2 @@
"use strict";const a=/[\t\n\r]/g;let e=!1;function o(a){return a>=97&&a<=122||a>=48&&a<=57||a>127||a>=65&&a<=90||45===a||95===a}function i(a,e,o){const i=o-e,s=32|a.charCodeAt(e);if(2===i)return 119===s&&115==(32|a.charCodeAt(e+1))?1:0;if(3===i){const o=32|a.charCodeAt(e+1),i=32|a.charCodeAt(e+2);return 119===s&&115===o&&115===i||102===s&&116===o&&112===i?1:0}if(4===i){const o=32|a.charCodeAt(e+1),i=32|a.charCodeAt(e+2),n=32|a.charCodeAt(e+3);return 104===s&&116===o&&116===i&&112===n?1:102===s&&105===o&&108===i&&101===n?2:0}return 5===i&&104===s&&116==(32|a.charCodeAt(e+1))&&116==(32|a.charCodeAt(e+2))&&112==(32|a.charCodeAt(e+3))&&115==(32|a.charCodeAt(e+4))?1:0}function s(n,t,r=!1){let u=0,l=n.length,m=!1,c=!1;if(e=!1,!t){if(n.startsWith("data:"))return null;for(;u<n.length&&n.charCodeAt(u)<=32;)u+=1;for(;l>u+1&&n.charCodeAt(l-1)<=32;)l-=1;if(47===n.charCodeAt(u)&&47===n.charCodeAt(u+1))u+=2;else{const e=n.indexOf(":/",u);if(-1!==e){const o=i(n,u,e);if(1===o)for(c=!0,u=e+2;47===n.charCodeAt(u)||92===n.charCodeAt(u);)u+=1;else if(2===o){c=!0,u=e+1;let a=0;for(;(47===n.charCodeAt(u)||92===n.charCodeAt(u))&&a<2;)u+=1,a+=1;if(a<2)return null}else{for(let o=u;o<e;o+=1){const e=32|n.charCodeAt(o);if(!(e>=97&&e<=122||e>=48&&e<=57||46===e||45===e||43===e)){const e=n.charCodeAt(o);return 9===e||10===e||13===e?s(n.replace(a,""),t,r):null}}if(47!==n.charCodeAt(e+2))return null;u=e+3}}else if(91!==n.charCodeAt(u)){let e=-1;for(let o=u;o<l;o+=1){const i=n.charCodeAt(o);if(9===i||10===i||13===i)return s(n.replace(a,""),t,r);if(58===i){e=o;break}if(47===i||92===i||63===i||35===i)break}if(-1!==e){let a=!1;for(let o=e+1;o<l;o+=1){const e=n.charCodeAt(o);if(47===e||92===e||63===e||35===e)break;if(64===e){a=!0;break}}if(!a){let a=!0,o=e+1;for(;o<l;o+=1){const e=n.charCodeAt(o);if(47===e||92===e||63===e||35===e)break;if(e<48||e>57){a=!1;break}}if(o===e+1&&(a=!1),!a){const a=i(n,u,e);if(0===a){let a=!1;for(let o=e+1;o<l;o+=1){const e=n.charCodeAt(o);if(47===e||92===e||63===e||35===e)break;if(58===e){a=!0;break}}if(!a)return null}else if(c=!0,u=e+1,2===a){let a=0;for(;(47===n.charCodeAt(u)||92===n.charCodeAt(u))&&a<2;)u+=1,a+=1;if(a<2)return null}else for(;47===n.charCodeAt(u)||92===n.charCodeAt(u);)u+=1}}}}}let d=-1,h=-1,g=-1,k=-1,p=!1,b=r,y=u-1,f=-1;if(r&&u<l){const a=n.charCodeAt(u);(!o(a)&&46!==a&&95!==a||45===a)&&(b=!1)}for(let a=u;a<l;a+=1){const e=n.charCodeAt(a);if(e<64){if(47===e||35===e||63===e){l=a;break}58===e?(-1===k&&(k=a),g=a):9===e||10===e||13===e?p=!0:r&&(46===e?((a-y>64||46===f||45===f)&&(b=!1),y=a):(e<48||e>57)&&(45===e&&46!==f||(b=!1)))}else{if(c&&92===e){l=a;break}64===e?(d=a,k=-1):93===e?h=a:e>=65&&e<=90?m=!0:r&&!function(a){return a>=97&&a<=122||a>=48&&a<=57||a>127||a>=65&&a<=90||45===a||95===a}(e)&&(b=!1)}r&&(f=e)}if(p)return s(n.replace(a,""),t,r);if(-1!==d&&d>=u&&d<l&&(u=d+1),91===n.charCodeAt(u))return-1!==h?n.slice(u+1,h).toLowerCase():null;if(-1!==g&&g>u&&g<l&&k===g&&(l=g),u>=l)return null;r&&b&&-1===d&&-1===g&&-1===h&&46!==n.charCodeAt(l-1)&&l-u<=255&&l-y-1<=63&&45!==f&&(e=!0)}for(;l>u+1&&46===n.charCodeAt(l-1);)l-=1;const d=0!==u||l!==n.length?n.slice(u,l):n;return m?d.toLowerCase():d}const n=["test","localhost","invalid","example","example.com","example.net","example.org","local","onion","alt","home.arpa","ipv4only.arpa","resolver.arpa","service.arpa","6tisch.arpa","eap.arpa"];function t(a){return a>=97&&a<=122||a>=48&&a<=57||a>127}function r(a){if(a.length>255)return!1;if(0===a.length)return!1;if(!t(a.charCodeAt(0))&&46!==a.charCodeAt(0)&&95!==a.charCodeAt(0))return!1;let e=-1,o=-1;const i=a.length;for(let s=0;s<i;s+=1){const i=a.charCodeAt(s);if(46===i){if(s-e>64||46===o||45===o)return!1;e=s}else if(!t(i)&&45!==i&&95!==i||45===i&&46===o)return!1;o=i}return i-e-1<=63&&45!==o}const u=function({allowIcannDomains:a=!0,allowPrivateDomains:e=!1,detectIp:o=!0,detectSpecialUse:i=!1,extractHostname:s=!0,mixedInputs:n=!0,validHosts:t=null,validateHostname:r=!0}){return{allowIcannDomains:a,allowPrivateDomains:e,detectIp:o,detectSpecialUse:i,extractHostname:s,mixedInputs:n,validHosts:t,validateHostname:r}}({});function l(a,o,i,t,l){const m=function(a){return void 0===a?u:function({allowIcannDomains:a=!0,allowPrivateDomains:e=!1,detectIp:o=!0,detectSpecialUse:i=!1,extractHostname:s=!0,mixedInputs:n=!0,validHosts:t=null,validateHostname:r=!0}){return{allowIcannDomains:a,allowPrivateDomains:e,detectIp:o,detectSpecialUse:i,extractHostname:s,mixedInputs:n,validHosts:t,validateHostname:r}}(a)}(t);if("string"!=typeof a)return l;let c=!1;return m.extractHostname?m.mixedInputs?(c=r(a),l.hostname=s(a,c,m.validateHostname)):l.hostname=s(a,!1,m.validateHostname):l.hostname=a,m.detectIp&&null!==l.hostname&&(l.isIp=function(a){if(a.length<3)return!1;let e=a.startsWith("[")?1:0,o=a.length;if("]"===a[o-1]&&(o-=1),o-e>39)return!1;let i=!1;for(;e<o;e+=1){const o=a.charCodeAt(e);if(58===o)i=!0;else if(!(o>=48&&o<=57||o>=97&&o<=102||o>=65&&o<=70))return!1}return i}(d=l.hostname)||function(a){if(a.length<7)return!1;if(a.lengLine truncated
//# sourceMappingURL=index.cjs.min.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.cjs.min.js","sources":["../../tldts-core/src/extract-hostname.ts","../../tldts-core/src/is-special-use.ts","../../tldts-core/src/is-valid.ts","../../tldts-core/src/options.ts","../../tldts-core/src/factory.ts","../../tldts-core/src/is-ip.ts","../../tldts-core/src/domain.ts","../../tldts-core/src/subdomain.ts","../../tldts-core/src/domain-without-suffix.ts","../src/data/trie.ts","../src/suffix-trie.ts","../../tldts-core/src/lookup/fast-path.ts","../index.ts"],"sourcesContent":["/**\n * Matches an ASCII tab (U+0009) or newline (U+000A / U+000D). The WHATWG URL\n * parser strips these before parsing; we only allocate a cleaned copy (and\n * re-parse) on the rare input that actually contains one.\n */\nconst CONTROL_CHARS = /[\\t\\n\\r]/g;\n\n// Set by `extractHostname` (a module-scope flag, read synchronously by\n// `parseImpl` right after the call — same pattern as the reused RESULT object).\n// `true` ONLY when extraction validated the returned host inline (a confirmed-\n// valid, \"simple\" authority) so `parseImpl` can skip the separate\n// `isValidHostname` pass. `false` in every other case (validation disabled, a\n// complex authority — userinfo/port/brackets/trailing-dot/control — an invalid\n// host, or a non-main return path); `parseImpl` then validates as usual. The\n// fast path can only ever SKIP a redundant scan for hosts already known valid,\n// never accept an invalid one.\nexport let extractedHostnameValidated = false;\n\n/**\n * True if char `code` is a valid hostname character. This is the per-char half\n * of `is-valid.ts`'s `isValidAscii` (a-z, 0-9, > U+007F) PLUS three additions:\n * A-Z (the host is lowercased before validation, so uppercase ≡ a valid\n * lowercase letter) and '-' / '_' (valid inside a label). KEEP IN SYNC with\n * `is-valid.ts`: these rules are deliberately duplicated to validate during\n * extraction, so any change to the accepted character set there must be\n * mirrored here (and vice-versa).\n */\nfunction isValidHostnameChar(code: number): boolean {\n return (\n (code >= 97 && code <= 122) || // a-z\n (code >= 48 && code <= 57) || // 0-9\n code > 127 || // non-ASCII (accepted, not punycode-checked)\n (code >= 65 && code <= 90) || // A-Z (becomes valid once lowercased)\n code === 45 || // '-'\n code === 95 // '_'\n );\n}\n\n/**\n * Classify scheme `url.slice(schemeStart, colonIndex)` as a WHATWG special\n * scheme without allocating a substring (case-insensitive via `| 32`).\n * Special schemes: ftp, file, http, https, ws, wss\n * (https://url.spec.whatwg.org/#special-scheme).\n *\n * @returns 0 = not special, 1 = special, 2 = file (its host sits only between\n * \"//\" and the next slash).\n */\nfunction getSpecialScheme(\n url: string,\n schemeStart: number,\n colonIndex: number,\n): number {\n const length = colonIndex - schemeStart;\n const c0 = url.charCodeAt(schemeStart) | 32;\n if (length === 2) {\n return c0 === 119 && (url.charCodeAt(schemeStart + 1) | 32) === 115 ? 1 : 0; // ws\n } else if (length === 3) {\n const c1 = url.charCodeAt(schemeStart + 1) | 32;\n const c2 = url.charCodeAt(schemeStart + 2) | 32;\n if (c0 === 119 && c1 === 115 && c2 === 115) return 1; // wss\n if (c0 === 102 && c1 === 116 && c2 === 112) return 1; // ftp\n return 0;\n } else if (length === 4) {\n const c1 = url.charCodeAt(schemeStart + 1) | 32;\n const c2 = url.charCodeAt(schemeStart + 2) | 32;\n const c3 = url.charCodeAt(schemeStart + 3) | 32;\n if (c0 === 104 && c1 === 116 && c2 === 116 && c3 === 112) return 1; // http\n if (c0 === 102 && c1 === 105 && c2 === 108 && c3 === 101) return 2; // file\n return 0;\n } else if (length === 5) {\n return c0 === 104 &&\n (url.charCodeAt(schemeStart + 1) | 32) === 116 &&\n (url.charCodeAt(schemeStart + 2) | 32) === 116 &&\n (url.charCodeAt(schemeStart + 3) | 32) === 112 &&\n (url.charCodeAt(schemeStart + 4) | 32) === 115\n ? 1\n : 0; // https\n }\n return 0;\n}\n\n/**\n * Extract a hostname from `url`, matching a WHATWG URL parser's host-boundary\n * behaviour (https://url.spec.whatwg.org/#concept-basic-url-parser) for tldts'\n * scope. It deliberately does NOT normalise the host (no IDNA/punycode or IPv4\n * canonicalisation; IPv6 brackets are stripped, not compressed), strips trailing\n * dots, and stays lenient where a strict parser rejects (bare host:port,\n * out-of-range port, user@host) — all documented deviations.\n *\n * @param urlIsValidHostname - when true, `url` is already a valid hostname and is\n * returned by the same reference (factory.ts skips re-validation on that\n * identity), keeping the common path allocation-free.\n * @param validate - when true, validate the host inline during the authority\n * scan and publish the verdict via `extractedHostnameValidated` so `parseImpl`\n * can skip the redundant `isValidHostname` pass for simple authorities.\n */\nexport default funLine truncated
+2
View File
@@ -0,0 +1,2 @@
const a=/[\t\n\r]/g;let e=!1;function o(a){return a>=97&&a<=122||a>=48&&a<=57||a>127||a>=65&&a<=90||45===a||95===a}function i(a,e,o){const i=o-e,s=32|a.charCodeAt(e);if(2===i)return 119===s&&115==(32|a.charCodeAt(e+1))?1:0;if(3===i){const o=32|a.charCodeAt(e+1),i=32|a.charCodeAt(e+2);return 119===s&&115===o&&115===i||102===s&&116===o&&112===i?1:0}if(4===i){const o=32|a.charCodeAt(e+1),i=32|a.charCodeAt(e+2),n=32|a.charCodeAt(e+3);return 104===s&&116===o&&116===i&&112===n?1:102===s&&105===o&&108===i&&101===n?2:0}return 5===i&&104===s&&116==(32|a.charCodeAt(e+1))&&116==(32|a.charCodeAt(e+2))&&112==(32|a.charCodeAt(e+3))&&115==(32|a.charCodeAt(e+4))?1:0}function s(n,t,r=!1){let u=0,l=n.length,m=!1,c=!1;if(e=!1,!t){if(n.startsWith("data:"))return null;for(;u<n.length&&n.charCodeAt(u)<=32;)u+=1;for(;l>u+1&&n.charCodeAt(l-1)<=32;)l-=1;if(47===n.charCodeAt(u)&&47===n.charCodeAt(u+1))u+=2;else{const e=n.indexOf(":/",u);if(-1!==e){const o=i(n,u,e);if(1===o)for(c=!0,u=e+2;47===n.charCodeAt(u)||92===n.charCodeAt(u);)u+=1;else if(2===o){c=!0,u=e+1;let a=0;for(;(47===n.charCodeAt(u)||92===n.charCodeAt(u))&&a<2;)u+=1,a+=1;if(a<2)return null}else{for(let o=u;o<e;o+=1){const e=32|n.charCodeAt(o);if(!(e>=97&&e<=122||e>=48&&e<=57||46===e||45===e||43===e)){const e=n.charCodeAt(o);return 9===e||10===e||13===e?s(n.replace(a,""),t,r):null}}if(47!==n.charCodeAt(e+2))return null;u=e+3}}else if(91!==n.charCodeAt(u)){let e=-1;for(let o=u;o<l;o+=1){const i=n.charCodeAt(o);if(9===i||10===i||13===i)return s(n.replace(a,""),t,r);if(58===i){e=o;break}if(47===i||92===i||63===i||35===i)break}if(-1!==e){let a=!1;for(let o=e+1;o<l;o+=1){const e=n.charCodeAt(o);if(47===e||92===e||63===e||35===e)break;if(64===e){a=!0;break}}if(!a){let a=!0,o=e+1;for(;o<l;o+=1){const e=n.charCodeAt(o);if(47===e||92===e||63===e||35===e)break;if(e<48||e>57){a=!1;break}}if(o===e+1&&(a=!1),!a){const a=i(n,u,e);if(0===a){let a=!1;for(let o=e+1;o<l;o+=1){const e=n.charCodeAt(o);if(47===e||92===e||63===e||35===e)break;if(58===e){a=!0;break}}if(!a)return null}else if(c=!0,u=e+1,2===a){let a=0;for(;(47===n.charCodeAt(u)||92===n.charCodeAt(u))&&a<2;)u+=1,a+=1;if(a<2)return null}else for(;47===n.charCodeAt(u)||92===n.charCodeAt(u);)u+=1}}}}}let d=-1,h=-1,g=-1,k=-1,p=!1,b=r,y=u-1,f=-1;if(r&&u<l){const a=n.charCodeAt(u);(!o(a)&&46!==a&&95!==a||45===a)&&(b=!1)}for(let a=u;a<l;a+=1){const e=n.charCodeAt(a);if(e<64){if(47===e||35===e||63===e){l=a;break}58===e?(-1===k&&(k=a),g=a):9===e||10===e||13===e?p=!0:r&&(46===e?((a-y>64||46===f||45===f)&&(b=!1),y=a):(e<48||e>57)&&(45===e&&46!==f||(b=!1)))}else{if(c&&92===e){l=a;break}64===e?(d=a,k=-1):93===e?h=a:e>=65&&e<=90?m=!0:r&&!function(a){return a>=97&&a<=122||a>=48&&a<=57||a>127||a>=65&&a<=90||45===a||95===a}(e)&&(b=!1)}r&&(f=e)}if(p)return s(n.replace(a,""),t,r);if(-1!==d&&d>=u&&d<l&&(u=d+1),91===n.charCodeAt(u))return-1!==h?n.slice(u+1,h).toLowerCase():null;if(-1!==g&&g>u&&g<l&&k===g&&(l=g),u>=l)return null;r&&b&&-1===d&&-1===g&&-1===h&&46!==n.charCodeAt(l-1)&&l-u<=255&&l-y-1<=63&&45!==f&&(e=!0)}for(;l>u+1&&46===n.charCodeAt(l-1);)l-=1;const d=0!==u||l!==n.length?n.slice(u,l):n;return m?d.toLowerCase():d}const n=["test","localhost","invalid","example","example.com","example.net","example.org","local","onion","alt","home.arpa","ipv4only.arpa","resolver.arpa","service.arpa","6tisch.arpa","eap.arpa"];function t(a){return a>=97&&a<=122||a>=48&&a<=57||a>127}function r(a){if(a.length>255)return!1;if(0===a.length)return!1;if(!t(a.charCodeAt(0))&&46!==a.charCodeAt(0)&&95!==a.charCodeAt(0))return!1;let e=-1,o=-1;const i=a.length;for(let s=0;s<i;s+=1){const i=a.charCodeAt(s);if(46===i){if(s-e>64||46===o||45===o)return!1;e=s}else if(!t(i)&&45!==i&&95!==i||45===i&&46===o)return!1;o=i}return i-e-1<=63&&45!==o}const u=function({allowIcannDomains:a=!0,allowPrivateDomains:e=!1,detectIp:o=!0,detectSpecialUse:i=!1,extractHostname:s=!0,mixedInputs:n=!0,validHosts:t=null,validateHostname:r=!0}){return{allowIcannDomains:a,allowPrivateDomains:e,detectIp:o,detectSpecialUse:i,extractHostname:s,mixedInputs:n,validHosts:t,validateHostname:r}}({});function l(a,o,i,t,l){const m=function(a){return void 0===a?u:function({allowIcannDomains:a=!0,allowPrivateDomains:e=!1,detectIp:o=!0,detectSpecialUse:i=!1,extractHostname:s=!0,mixedInputs:n=!0,validHosts:t=null,validateHostname:r=!0}){return{allowIcannDomains:a,allowPrivateDomains:e,detectIp:o,detectSpecialUse:i,extractHostname:s,mixedInputs:n,validHosts:t,validateHostname:r}}(a)}(t);if("string"!=typeof a)return l;let c=!1;return m.extractHostname?m.mixedInputs?(c=r(a),l.hostname=s(a,c,m.validateHostname)):l.hostname=s(a,!1,m.validateHostname):l.hostname=a,m.detectIp&&null!==l.hostname&&(l.isIp=function(a){if(a.length<3)return!1;let e=a.startsWith("[")?1:0,o=a.length;if("]"===a[o-1]&&(o-=1),o-e>39)return!1;let i=!1;for(;e<o;e+=1){const o=a.charCodeAt(e);if(58===o)i=!0;else if(!(o>=48&&o<=57||o>=97&&o<=102||o>=65&&o<=70))return!1}return i}(d=l.hostname)||function(a){if(a.length<7)return!1;if(a.length>15)return!Line truncated
//# sourceMappingURL=index.esm.min.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.esm.min.js","sources":["../../tldts-core/src/extract-hostname.ts","../../tldts-core/src/is-special-use.ts","../../tldts-core/src/is-valid.ts","../../tldts-core/src/options.ts","../../tldts-core/src/factory.ts","../../tldts-core/src/is-ip.ts","../../tldts-core/src/domain.ts","../../tldts-core/src/subdomain.ts","../../tldts-core/src/domain-without-suffix.ts","../src/data/trie.ts","../src/suffix-trie.ts","../../tldts-core/src/lookup/fast-path.ts","../index.ts"],"sourcesContent":["/**\n * Matches an ASCII tab (U+0009) or newline (U+000A / U+000D). The WHATWG URL\n * parser strips these before parsing; we only allocate a cleaned copy (and\n * re-parse) on the rare input that actually contains one.\n */\nconst CONTROL_CHARS = /[\\t\\n\\r]/g;\n\n// Set by `extractHostname` (a module-scope flag, read synchronously by\n// `parseImpl` right after the call — same pattern as the reused RESULT object).\n// `true` ONLY when extraction validated the returned host inline (a confirmed-\n// valid, \"simple\" authority) so `parseImpl` can skip the separate\n// `isValidHostname` pass. `false` in every other case (validation disabled, a\n// complex authority — userinfo/port/brackets/trailing-dot/control — an invalid\n// host, or a non-main return path); `parseImpl` then validates as usual. The\n// fast path can only ever SKIP a redundant scan for hosts already known valid,\n// never accept an invalid one.\nexport let extractedHostnameValidated = false;\n\n/**\n * True if char `code` is a valid hostname character. This is the per-char half\n * of `is-valid.ts`'s `isValidAscii` (a-z, 0-9, > U+007F) PLUS three additions:\n * A-Z (the host is lowercased before validation, so uppercase ≡ a valid\n * lowercase letter) and '-' / '_' (valid inside a label). KEEP IN SYNC with\n * `is-valid.ts`: these rules are deliberately duplicated to validate during\n * extraction, so any change to the accepted character set there must be\n * mirrored here (and vice-versa).\n */\nfunction isValidHostnameChar(code: number): boolean {\n return (\n (code >= 97 && code <= 122) || // a-z\n (code >= 48 && code <= 57) || // 0-9\n code > 127 || // non-ASCII (accepted, not punycode-checked)\n (code >= 65 && code <= 90) || // A-Z (becomes valid once lowercased)\n code === 45 || // '-'\n code === 95 // '_'\n );\n}\n\n/**\n * Classify scheme `url.slice(schemeStart, colonIndex)` as a WHATWG special\n * scheme without allocating a substring (case-insensitive via `| 32`).\n * Special schemes: ftp, file, http, https, ws, wss\n * (https://url.spec.whatwg.org/#special-scheme).\n *\n * @returns 0 = not special, 1 = special, 2 = file (its host sits only between\n * \"//\" and the next slash).\n */\nfunction getSpecialScheme(\n url: string,\n schemeStart: number,\n colonIndex: number,\n): number {\n const length = colonIndex - schemeStart;\n const c0 = url.charCodeAt(schemeStart) | 32;\n if (length === 2) {\n return c0 === 119 && (url.charCodeAt(schemeStart + 1) | 32) === 115 ? 1 : 0; // ws\n } else if (length === 3) {\n const c1 = url.charCodeAt(schemeStart + 1) | 32;\n const c2 = url.charCodeAt(schemeStart + 2) | 32;\n if (c0 === 119 && c1 === 115 && c2 === 115) return 1; // wss\n if (c0 === 102 && c1 === 116 && c2 === 112) return 1; // ftp\n return 0;\n } else if (length === 4) {\n const c1 = url.charCodeAt(schemeStart + 1) | 32;\n const c2 = url.charCodeAt(schemeStart + 2) | 32;\n const c3 = url.charCodeAt(schemeStart + 3) | 32;\n if (c0 === 104 && c1 === 116 && c2 === 116 && c3 === 112) return 1; // http\n if (c0 === 102 && c1 === 105 && c2 === 108 && c3 === 101) return 2; // file\n return 0;\n } else if (length === 5) {\n return c0 === 104 &&\n (url.charCodeAt(schemeStart + 1) | 32) === 116 &&\n (url.charCodeAt(schemeStart + 2) | 32) === 116 &&\n (url.charCodeAt(schemeStart + 3) | 32) === 112 &&\n (url.charCodeAt(schemeStart + 4) | 32) === 115\n ? 1\n : 0; // https\n }\n return 0;\n}\n\n/**\n * Extract a hostname from `url`, matching a WHATWG URL parser's host-boundary\n * behaviour (https://url.spec.whatwg.org/#concept-basic-url-parser) for tldts'\n * scope. It deliberately does NOT normalise the host (no IDNA/punycode or IPv4\n * canonicalisation; IPv6 brackets are stripped, not compressed), strips trailing\n * dots, and stays lenient where a strict parser rejects (bare host:port,\n * out-of-range port, user@host) — all documented deviations.\n *\n * @param urlIsValidHostname - when true, `url` is already a valid hostname and is\n * returned by the same reference (factory.ts skips re-validation on that\n * identity), keeping the common path allocation-free.\n * @param validate - when true, validate the host inline during the authority\n * scan and publish the verdict via `extractedHostnameValidated` so `parseImpl`\n * can skip the redundant `isValidHostname` pass for simple authorities.\n */\nexport default funLine truncated
+2
View File
@@ -0,0 +1,2 @@
!function(a,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((a="undefined"!=typeof globalThis?globalThis:a||self).tldts={})}(this,(function(a){"use strict";const e=/[\t\n\r]/g;let o=!1;function i(a){return a>=97&&a<=122||a>=48&&a<=57||a>127||a>=65&&a<=90||45===a||95===a}function n(a,e,o){const i=o-e,n=32|a.charCodeAt(e);if(2===i)return 119===n&&115==(32|a.charCodeAt(e+1))?1:0;if(3===i){const o=32|a.charCodeAt(e+1),i=32|a.charCodeAt(e+2);return 119===n&&115===o&&115===i||102===n&&116===o&&112===i?1:0}if(4===i){const o=32|a.charCodeAt(e+1),i=32|a.charCodeAt(e+2),s=32|a.charCodeAt(e+3);return 104===n&&116===o&&116===i&&112===s?1:102===n&&105===o&&108===i&&101===s?2:0}return 5===i&&104===n&&116==(32|a.charCodeAt(e+1))&&116==(32|a.charCodeAt(e+2))&&112==(32|a.charCodeAt(e+3))&&115==(32|a.charCodeAt(e+4))?1:0}function s(a,t,r=!1){let u=0,l=a.length,m=!1,c=!1;if(o=!1,!t){if(a.startsWith("data:"))return null;for(;u<a.length&&a.charCodeAt(u)<=32;)u+=1;for(;l>u+1&&a.charCodeAt(l-1)<=32;)l-=1;if(47===a.charCodeAt(u)&&47===a.charCodeAt(u+1))u+=2;else{const o=a.indexOf(":/",u);if(-1!==o){const i=n(a,u,o);if(1===i)for(c=!0,u=o+2;47===a.charCodeAt(u)||92===a.charCodeAt(u);)u+=1;else if(2===i){c=!0,u=o+1;let e=0;for(;(47===a.charCodeAt(u)||92===a.charCodeAt(u))&&e<2;)u+=1,e+=1;if(e<2)return null}else{for(let i=u;i<o;i+=1){const o=32|a.charCodeAt(i);if(!(o>=97&&o<=122||o>=48&&o<=57||46===o||45===o||43===o)){const o=a.charCodeAt(i);return 9===o||10===o||13===o?s(a.replace(e,""),t,r):null}}if(47!==a.charCodeAt(o+2))return null;u=o+3}}else if(91!==a.charCodeAt(u)){let o=-1;for(let i=u;i<l;i+=1){const n=a.charCodeAt(i);if(9===n||10===n||13===n)return s(a.replace(e,""),t,r);if(58===n){o=i;break}if(47===n||92===n||63===n||35===n)break}if(-1!==o){let e=!1;for(let i=o+1;i<l;i+=1){const o=a.charCodeAt(i);if(47===o||92===o||63===o||35===o)break;if(64===o){e=!0;break}}if(!e){let e=!0,i=o+1;for(;i<l;i+=1){const o=a.charCodeAt(i);if(47===o||92===o||63===o||35===o)break;if(o<48||o>57){e=!1;break}}if(i===o+1&&(e=!1),!e){const e=n(a,u,o);if(0===e){let e=!1;for(let i=o+1;i<l;i+=1){const o=a.charCodeAt(i);if(47===o||92===o||63===o||35===o)break;if(58===o){e=!0;break}}if(!e)return null}else if(c=!0,u=o+1,2===e){let e=0;for(;(47===a.charCodeAt(u)||92===a.charCodeAt(u))&&e<2;)u+=1,e+=1;if(e<2)return null}else for(;47===a.charCodeAt(u)||92===a.charCodeAt(u);)u+=1}}}}}let d=-1,h=-1,g=-1,k=-1,p=!1,b=r,y=u-1,f=-1;if(r&&u<l){const e=a.charCodeAt(u);(!i(e)&&46!==e&&95!==e||45===e)&&(b=!1)}for(let e=u;e<l;e+=1){const o=a.charCodeAt(e);if(o<64){if(47===o||35===o||63===o){l=e;break}58===o?(-1===k&&(k=e),g=e):9===o||10===o||13===o?p=!0:r&&(46===o?((e-y>64||46===f||45===f)&&(b=!1),y=e):(o<48||o>57)&&(45===o&&46!==f||(b=!1)))}else{if(c&&92===o){l=e;break}64===o?(d=e,k=-1):93===o?h=e:o>=65&&o<=90?m=!0:r&&!function(a){return a>=97&&a<=122||a>=48&&a<=57||a>127||a>=65&&a<=90||45===a||95===a}(o)&&(b=!1)}r&&(f=o)}if(p)return s(a.replace(e,""),t,r);if(-1!==d&&d>=u&&d<l&&(u=d+1),91===a.charCodeAt(u))return-1!==h?a.slice(u+1,h).toLowerCase():null;if(-1!==g&&g>u&&g<l&&k===g&&(l=g),u>=l)return null;r&&b&&-1===d&&-1===g&&-1===h&&46!==a.charCodeAt(l-1)&&l-u<=255&&l-y-1<=63&&45!==f&&(o=!0)}for(;l>u+1&&46===a.charCodeAt(l-1);)l-=1;const d=0!==u||l!==a.length?a.slice(u,l):a;return m?d.toLowerCase():d}const t=["test","localhost","invalid","example","example.com","example.net","example.org","local","onion","alt","home.arpa","ipv4only.arpa","resolver.arpa","service.arpa","6tisch.arpa","eap.arpa"];function r(a){return a>=97&&a<=122||a>=48&&a<=57||a>127}function u(a){if(a.length>255)return!1;if(0===a.length)return!1;if(!r(a.charCodeAt(0))&&46!==a.charCodeAt(0)&&95!==a.charCodeAt(0))return!1;let e=-1,o=-1;const i=a.length;for(let n=0;n<i;n+=1){const i=a.charCodeAt(n);if(46===i){if(n-e>64||46===o||45===o)return!1;e=n}else if(!r(i)&&45!==i&&95!==i||45===i&&46===o)return!1;o=i}return i-e-1<=63&&45!==o}const l=function({allowIcannDomains:a=!0,allowPrivateDomains:e=!1,detectIp:o=!0,detectSpecialUse:i=!1,extractHostname:n=!0,mixedInputs:s=!0,validHosts:t=null,validateHostname:r=!0}){return{allowIcannDomains:a,allowPrivateDomains:e,detectIp:o,detectSpecialUse:i,extractHostname:n,mixedInputs:s,validHosts:t,validateHostname:r}}({});function m(a,e,i,n,r){const m=function(a){return void 0===a?l:function({allowIcannDomains:a=!0,allowPrivateDomains:e=!1,detectIp:o=!0,detectSpecialUse:i=!1,extractHostname:n=!0,mixedInputs:s=!0,validHosts:t=null,validateHostname:r=!0}){return{allowIcannDomains:a,allowPrivateDomains:e,detectIp:o,detectSpecialUse:i,extractHostname:n,mixedInputs:s,validHosts:t,validateHostname:r}}(a)}(n);if("string"!=typeof a)return r;let c=!1;return m.extractHostname?m.mixedInputs?(c=u(a),r.hostname=s(a,c,m.validateHostname)):r.hostname=s(a,!1,m.validateHostname):r.hostname=a,m.detectIp&&null!==r.hostname&&(r.isIp=function(a){if(a.length<3)return!1;let e=a.startsWith("[")?1:0,o=a.length;if("]"===aLine truncated
//# sourceMappingURL=index.umd.min.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"index.umd.min.js","sources":["../../tldts-core/src/extract-hostname.ts","../../tldts-core/src/is-special-use.ts","../../tldts-core/src/is-valid.ts","../../tldts-core/src/options.ts","../../tldts-core/src/factory.ts","../../tldts-core/src/is-ip.ts","../../tldts-core/src/domain.ts","../../tldts-core/src/subdomain.ts","../../tldts-core/src/domain-without-suffix.ts","../src/data/trie.ts","../src/suffix-trie.ts","../../tldts-core/src/lookup/fast-path.ts","../index.ts"],"sourcesContent":["/**\n * Matches an ASCII tab (U+0009) or newline (U+000A / U+000D). The WHATWG URL\n * parser strips these before parsing; we only allocate a cleaned copy (and\n * re-parse) on the rare input that actually contains one.\n */\nconst CONTROL_CHARS = /[\\t\\n\\r]/g;\n\n// Set by `extractHostname` (a module-scope flag, read synchronously by\n// `parseImpl` right after the call — same pattern as the reused RESULT object).\n// `true` ONLY when extraction validated the returned host inline (a confirmed-\n// valid, \"simple\" authority) so `parseImpl` can skip the separate\n// `isValidHostname` pass. `false` in every other case (validation disabled, a\n// complex authority — userinfo/port/brackets/trailing-dot/control — an invalid\n// host, or a non-main return path); `parseImpl` then validates as usual. The\n// fast path can only ever SKIP a redundant scan for hosts already known valid,\n// never accept an invalid one.\nexport let extractedHostnameValidated = false;\n\n/**\n * True if char `code` is a valid hostname character. This is the per-char half\n * of `is-valid.ts`'s `isValidAscii` (a-z, 0-9, > U+007F) PLUS three additions:\n * A-Z (the host is lowercased before validation, so uppercase ≡ a valid\n * lowercase letter) and '-' / '_' (valid inside a label). KEEP IN SYNC with\n * `is-valid.ts`: these rules are deliberately duplicated to validate during\n * extraction, so any change to the accepted character set there must be\n * mirrored here (and vice-versa).\n */\nfunction isValidHostnameChar(code: number): boolean {\n return (\n (code >= 97 && code <= 122) || // a-z\n (code >= 48 && code <= 57) || // 0-9\n code > 127 || // non-ASCII (accepted, not punycode-checked)\n (code >= 65 && code <= 90) || // A-Z (becomes valid once lowercased)\n code === 45 || // '-'\n code === 95 // '_'\n );\n}\n\n/**\n * Classify scheme `url.slice(schemeStart, colonIndex)` as a WHATWG special\n * scheme without allocating a substring (case-insensitive via `| 32`).\n * Special schemes: ftp, file, http, https, ws, wss\n * (https://url.spec.whatwg.org/#special-scheme).\n *\n * @returns 0 = not special, 1 = special, 2 = file (its host sits only between\n * \"//\" and the next slash).\n */\nfunction getSpecialScheme(\n url: string,\n schemeStart: number,\n colonIndex: number,\n): number {\n const length = colonIndex - schemeStart;\n const c0 = url.charCodeAt(schemeStart) | 32;\n if (length === 2) {\n return c0 === 119 && (url.charCodeAt(schemeStart + 1) | 32) === 115 ? 1 : 0; // ws\n } else if (length === 3) {\n const c1 = url.charCodeAt(schemeStart + 1) | 32;\n const c2 = url.charCodeAt(schemeStart + 2) | 32;\n if (c0 === 119 && c1 === 115 && c2 === 115) return 1; // wss\n if (c0 === 102 && c1 === 116 && c2 === 112) return 1; // ftp\n return 0;\n } else if (length === 4) {\n const c1 = url.charCodeAt(schemeStart + 1) | 32;\n const c2 = url.charCodeAt(schemeStart + 2) | 32;\n const c3 = url.charCodeAt(schemeStart + 3) | 32;\n if (c0 === 104 && c1 === 116 && c2 === 116 && c3 === 112) return 1; // http\n if (c0 === 102 && c1 === 105 && c2 === 108 && c3 === 101) return 2; // file\n return 0;\n } else if (length === 5) {\n return c0 === 104 &&\n (url.charCodeAt(schemeStart + 1) | 32) === 116 &&\n (url.charCodeAt(schemeStart + 2) | 32) === 116 &&\n (url.charCodeAt(schemeStart + 3) | 32) === 112 &&\n (url.charCodeAt(schemeStart + 4) | 32) === 115\n ? 1\n : 0; // https\n }\n return 0;\n}\n\n/**\n * Extract a hostname from `url`, matching a WHATWG URL parser's host-boundary\n * behaviour (https://url.spec.whatwg.org/#concept-basic-url-parser) for tldts'\n * scope. It deliberately does NOT normalise the host (no IDNA/punycode or IPv4\n * canonicalisation; IPv6 brackets are stripped, not compressed), strips trailing\n * dots, and stays lenient where a strict parser rejects (bare host:port,\n * out-of-range port, user@host) — all documented deviations.\n *\n * @param urlIsValidHostname - when true, `url` is already a valid hostname and is\n * returned by the same reference (factory.ts skips re-validation on that\n * identity), keeping the common path allocation-free.\n * @param validate - when true, validate the host inline during the authority\n * scan and publish the verdict via `extractedHostnameValidated` so `parseImpl`\n * can skip the redundant `isValidHostname` pass for simple authorities.\n */\nexport default funLine truncated
+8
View File
@@ -0,0 +1,8 @@
import { IOptions, IResult } from 'tldts-core';
export declare function parse(url: string, options?: Partial<IOptions>): IResult;
export declare function getHostname(url: string, options?: Partial<IOptions>): string | null;
export declare function getPublicSuffix(url: string, options?: Partial<IOptions>): string | null;
export declare function getDomain(url: string, options?: Partial<IOptions>): string | null;
export declare function getFullDomain(url: string, options?: Partial<IOptions>): string | null;
export declare function getSubdomain(url: string, options?: Partial<IOptions>): string | null;
export declare function getDomainWithoutSuffix(url: string, options?: Partial<IOptions>): string | null;
+7
View File
@@ -0,0 +1,7 @@
export declare const nodeFlags: Uint8Array<ArrayBuffer>;
export declare const edgeStart: Uint16Array<ArrayBuffer>;
export declare const edgeLength: Uint8Array<ArrayBuffer>;
export declare const edgeChild: Uint16Array<ArrayBuffer>;
export declare const labelText = "orgmilcomschnetedugovdrrformsfeedbackofficialaccoorgmilschnetgovmagazinemediaunioncargopilotgroupcaarespressworksaerodromeworkinggroupair-traffic-controlaircraftaccident-preventioneducatormarketplaceambulanceinsurancecateringairportrepbodyenginesoftwaremodellingair-surveillanceconsultingchartertrainermaintenanceservicesdesignflightskydivingfreightassociationstudentgroundhandlingdgcafuelclubtaxicrewshowballooningexpresstraderbrokerauthoragentsairtrafficjournalistsafetyconsultantmicrolightaccident-investigationparachutingequipmentproductionfederationrecreationscientistnavigationengineertradingglidingleasingresearchpassenger-associationentertainmentparaglidinghangglidingaerobaticrotorcraftemergencycertificationgovernmentaeroclubexchangelogisticschampionshiphomebuiltcouncilconferencecontrolairlinecivilaviationjournalorgcomnetedugovcoorgcomnomnetobjofforgcomnetuwukiloappsframerorgmilcomnetedugovcoradioorgcomnetcommuneedogpbcoitgvorgedugov*spreviewfrontendrelayononstagingupid*mtls*privatelinktypedreamdeveloperbravemochawindsurfaivenmirenupsunwnextbegetngrokclerkwale2bwebcsbrunputerflutterflowspawnbaseshiptodaymagicpatternsnetlifyondigitaloceanrailwayhostedclaudehasurabotdashvercelgithubluyanigadgetreplitcloudflaretelebitedgecomputeevervaultexponyatnoopencrpplxzeaburwasmerframerzeropsrocketpreviewconvexmedusajsspritesonherculeseasypanelstreamlitsnowflakemesserliloginlinehackclubcodepennorthflankbase44corespeedleapcellngrok-freeclerkstagelovableon-fleek*us-west-3ap-south-2us-central-2us-central-1eu-central-1ap-south-1us-west-2us-east-2eu-north-1ap-north-1us-west-1us-east-1*rcloudintsegorgmilcomgobbetnetintedugovturmusicasenasamutualcoopip6uriurnin-addre164homeirisgovdixdaemoncloudnssthwien*inexexkunden4accogvormymyspreadshop4lima2ixortsinfofuturecmsfuturehosting12hpprivfuturemailinglima-cityfunkfeuer123webseitednshomemelmyspreadshopcloudletswasantqldvicactnswtascatholicwasaqldvictasidwasantozqldorgcomvicasnactnetedugovnswtasconfcomairflowlambda-urltransfer-webappairflowtransfer-webapptransfer-webapptransfer-webapp-fipstransfer-webappeu-west-3ap-south-2eu-south-2eu-central-2ap-southeast-3ap-southeast-4ap-northeast-3eu-central-1mx-central-1me-central-1ca-central-1il-central-1ap-northeast-1ap-southeast-1me-south-1af-south-1eu-south-1ap-south-1ap-southeast-7us-west-2eu-west-2us-east-2eu-north-1ap-southeast-2ap-northeast-2ap-southeast-5us-gov-west-1us-gov-east-1ca-west-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1privatenotebookstudiolabelingnotebookstudionotebooknotebook-fipslabelingnotebookstudionotebook-fipsnotebookstudio-fipsnotebook-fipsnotebookstudionotebook-fipsnotebookstudioeu-west-3ap-south-2eu-south-2eu-central-2ap-southeast-3ap-southeast-4ap-northeast-3eu-central-1me-central-1ca-central-1il-central-1ap-northeast-1ap-southeast-1me-south-1af-south-1eu-south-1ap-south-1us-west-2eu-west-2us-east-2eu-north-1ap-southeast-2ap-northeast-2experimentsus-gov-west-1us-gov-east-1ca-west-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1onrepostsagemakercopporgmilcompronetintedugovbiznameinfoshoprsorgmilcomnetedugovbrendlyresolvenzauscotvstoreorgcomnetedugovbizinfoidacaicoittvorgmilcomschnetedugovinfocloudezproxyacmymyspreadshopkuleuvenwebhostingtransurl123websitecloudnsinterhostsolutionsddns5476103298edgfacbmlonihkjutwvqpsryxzbarsycoororgcomedumyftpno-iporxcloud-ipfor-somemmafanfor-morewebhopselfipjozidyndnscloudnsdscloudfor-thefor-betteractivetrailcoeconorestooteorgcomeconeteduassurmoneyafricaarchitectesrestaurantloisirstourismavocatsinfoagrounivcoorgcomnetedugoviatvdeportesaludtksatorgmilcomwebgobnetinteducienciaboliviarevistacooperativaempresanombreindustriamusicapatriamedicinademocraciapoliticapuebloindigenaplurinacionalarteblogwikiinfoagrotransportenoticiasprofesionalacademiaeconomiaecologiamovimientotecnologianaturalsimplesitecepesebamapadfmgalampbacscpirngorotomtrjspaprrprrsesmscepesebamapadfmgalampbacscpirngorotomtrjspaprrprrsesms*biaamfmtcmptvfeirasampajampanatalbelemananiradiog12medindfndbmdtrdthepoaggfjdfdefinfenflegsegongengcngorgzlgslglogppgmillelqslcimcomnomadmjabimbbibbsbabcrectecsjcetcpscpvhudieticriapipsiecnbiorioecogeoteoodoproatoartfstmatvetdetbetnetcntnotfotgrueduajuespappreptmpemparqsrvadvdevgovntrturagrjorfarjusmusdesvixxyzcozfozslzbhzmaringasantamariacampinagrandegoianiasorocabafloripasaobernardocuritibaboavistarecifeaparecidasaogoncasalvadorcuiabamorenamacapalondrinacontagemsocialfortalmaceioleilaoosascoriobranconiteroi9guacutcheblogflogvlogwikitaxicoopmanauspalmascaxiasjoinvillebaruericampinassantoandreribeiraoriopretoweorgcomnetedugovv0windsurfshiptodaycloudsitecoaccoorgnetgovofmilcomgovmediatechzacoorgcomnetedugsjgovmydnspenfnlabnbmbgcbcqconcontnuyksknsmyspreadshopno-ipawdevboxbarsyonidatemfuinabusavinstanceseceuguukussryzespawncsxcloud-ipmyphotosfantasyleaguetwmailcleverappsscrappingccwucloudnsftpaccessgame-serverccgovobjectsrmalpgcust*svcalp1aeappenginermalpgmyspreadshop4lima2ixsquare7cloudscale123websitefirenet12hpflowgotdnslinkyard-cloudcloudnslima-citydnskingLine truncated
export declare const rulesRoot = 620;
export declare const exceptionsRoot = 624;
+5
View File
@@ -0,0 +1,5 @@
import { IPublicSuffix, ISuffixLookupOptions } from 'tldts-core';
/**
* Check if `hostname` has a valid public suffix in the trie.
*/
export default function suffixLookup(hostname: string, options: ISuffixLookupOptions, out: IPublicSuffix): void;
+74
View File
@@ -0,0 +1,74 @@
import {
FLAG,
getEmptyResult,
IOptions,
IResult,
parseImpl,
resetResult,
} from 'tldts-core';
import suffixLookup from './src/suffix-trie';
// For all methods but 'parse', it does not make sense to allocate an object
// every single time to only return the value of a specific attribute. To avoid
// this un-necessary allocation, we use a global object which is re-used.
const RESULT: IResult = getEmptyResult();
export function parse(url: string, options?: Partial<IOptions>): IResult {
return parseImpl(url, FLAG.ALL, suffixLookup, options, getEmptyResult());
}
export function getHostname(
url: string,
options?: Partial<IOptions>,
): string | null {
/*@__INLINE__*/ resetResult(RESULT);
return parseImpl(url, FLAG.HOSTNAME, suffixLookup, options, RESULT).hostname;
}
export function getPublicSuffix(
url: string,
options?: Partial<IOptions>,
): string | null {
/*@__INLINE__*/ resetResult(RESULT);
return parseImpl(url, FLAG.PUBLIC_SUFFIX, suffixLookup, options, RESULT)
.publicSuffix;
}
export function getDomain(
url: string,
options?: Partial<IOptions>,
): string | null {
/*@__INLINE__*/ resetResult(RESULT);
return parseImpl(url, FLAG.DOMAIN, suffixLookup, options, RESULT).domain;
}
export function getFullDomain(
url: string,
options?: Partial<IOptions>,
): string | null {
/*@__INLINE__*/ resetResult(RESULT);
const result = parseImpl(url, FLAG.DOMAIN, suffixLookup, options, RESULT);
// The hostname *is* the full domain (subdomain + domain) whenever a
// registrable domain exists; gate on `domain` so non-registrable inputs
// (IPs, suffix-less or invalid hostnames) return `null` like `getDomain`.
return result.domain === null ? null : result.hostname;
}
export function getSubdomain(
url: string,
options?: Partial<IOptions>,
): string | null {
/*@__INLINE__*/ resetResult(RESULT);
return parseImpl(url, FLAG.SUB_DOMAIN, suffixLookup, options, RESULT)
.subdomain;
}
export function getDomainWithoutSuffix(
url: string,
options?: Partial<IOptions>,
): string | null {
/*@__INLINE__*/ resetResult(RESULT);
return parseImpl(url, FLAG.ALL, suffixLookup, options, RESULT)
.domainWithoutSuffix;
}
+89
View File
@@ -0,0 +1,89 @@
{
"name": "tldts",
"version": "7.4.12",
"description": "Library to work against complex domain names, subdomains and URIs.",
"author": {
"name": "Rémi Berson"
},
"contributors": [
"Alexei <alexeiatyahoodotcom@gmail.com>",
"Alexey <kureev-mail@ya.ru>",
"Andrew <chefandrew@seomoz.org>",
"Johannes Ewald <johannes.ewald@peerigon.com>",
"Jérôme Desboeufs <jerome.desboeufs@gmail.com>",
"Kelly Campbell <kelly.a.campbell@gmail.com>",
"Kiko Beats <josefrancisco.verdu@gmail.com>",
"Kris Reeves <krisreeves@searchfanatics.com>",
"Krzysztof Jan Modras <chrmod@chrmod.net>",
"Olivier Melcher <olivier.melcher@gmail.com>",
"Rémi Berson <remi.berson@pm.me>",
"Saad Rashid <srashid@lendinghome.com>",
"Thomas Parisot <hi@oncletom.io>",
"Timo Tijhof <krinklemail@gmail.com>",
"Xavier Damman <xdamman@gmail.com>",
"Yehezkiel Syamsuhadi <yehezkielbs@gmail.com>"
],
"publishConfig": {
"access": "public"
},
"license": "MIT",
"homepage": "https://github.com/remusao/tldts#readme",
"bugs": {
"url": "https://github.com/remusao/tldts/issues"
},
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/remusao/tldts.git"
},
"main": "dist/cjs/index.js",
"module": "dist/es6/index.js",
"types": "dist/types/index.d.ts",
"files": [
"dist",
"src",
"index.ts"
],
"bin": "bin/cli.js",
"scripts": {
"clean": "rimraf dist coverage",
"build": "tsc --build ./tsconfig.json",
"bundle": "tsc --build ./tsconfig.bundle.json && rollup --config ./rollup.config.mjs",
"prepack": "yarn run bundle",
"test": "nyc ../../node_modules/.bin/mocha --config ../../.mocharc.cjs"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^16.0.3",
"@rollup/plugin-terser": "^1.0.0",
"@rollup/plugin-typescript": "^12.3.0",
"@types/chai": "^5.2.3",
"@types/mocha": "^10.0.10",
"@types/node": "^26.1.0",
"chai": "^6.2.2",
"mocha": "^12.0.0",
"nyc": "^18.0.0",
"rimraf": "^6.1.2",
"rollup": "^4.57.1",
"rollup-plugin-sourcemaps2": "^0.5.4",
"tldts-tests": "^7.4.12",
"typescript": "^5.9.3"
},
"dependencies": {
"tldts-core": "^7.4.12"
},
"keywords": [
"tld",
"sld",
"domain",
"subdomain",
"subdomain",
"hostname",
"browser",
"uri",
"url",
"domain name",
"public suffix",
"url parsing",
"typescript"
],
"gitHead": "73b7e6bd4593cadf2d13601fdcf6ae7eb603f146"
}
+8
View File
@@ -0,0 +1,8 @@
// Auto-generated flat public-suffix trie. Do not edit.
export const nodeFlags = /*#__PURE__*/ new Uint8Array([1,2,1,1,1,1,1,1,1,1,1,1,0,2,2,2,0,2,2,0,2,0,0,1,0,0,2,1,1,1,1,1,1,0,0,0,1,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,1,0,1,1,0,0,0,0,0,0,1,1,1,0,2,0,0,0,0,0,0,0,2,0,2,2,0,0,2,2,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,2,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,2,2,0,0,0,0,2,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,2,0,0,0,0,2,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,0,1,0,2,2,0,0,0,2,0,1,1,0,2,0,2,2,0,1,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,1,0,0,0,0,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,2,2,0,2,2,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,2,2,0,2,2,2,2,0,0,0,0,2,0,0,0,0,0,0,0,2,2,0,0,0,2,2,1,1,1,1,1,2,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,2,2,0,0,2,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,2,2,1,2,1,1,1,2,1,1,1,1,1,0,1,1,1,1,2,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,2,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,0,0,0,0,0]);
export const edgeStart = /*#__PURE__*/ new Uint16Array([0,0,0,10,11,18,106,111,117,124,130,136,145,146,147,148,149,150,151,153,154,155,157,159,226,239,241,242,243,258,265,266,269,270,271,274,276,295,296,298,307,312,329,330,333,335,336,338,372,373,375,378,379,383,385,389,392,424,427,440,441,449,450,452,462,476,477,478,487,488,525,530,546,566,572,614,615,642,669,670,818,824,827,828,829,834,839,848,870,871,872,873,874,875,876,894,896,897,900,902,903,905,907,922,937,942,943,945,946,947,948,949,951,954,959,960,961,963,964,967,970,971,972,985,987,999,1010,1018,1020,1061,1064,1068,1069,1071,1074,1085,1087,1097,1099,1105,1107,1108,1110,1113,1114,1115,1168,1170,1172,1192,1193,1194,1195,1197,1208,1239,1250,1262,1271,1278,1283,1296,1307,1320,1321,1332,1366,1367,1368,1383,1398,1470,1471,1473,1474,1508,1509,1510,1511,1514,1518,1520,1549,1550,1558,1559,1560,1562,1564,1565,1567,1568,1569,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1595,1596,1597,2051,2054,2055,2057,2064,2071,2081,2085,2096,2097,2098,2110,2111,2113,2115,2116,2123,2124,2126,2127,2129,2130,2131,2132,2133,2207,2209,2230,2231,2232,2234,2260,2261,2312,2313,2315,2322,2328,2338,2348,2401,2402,2403,2413,2427,2428,2431,2438,2439,2447,2448,2449,2450,2451,2462,2463,2464,2466,2467,2468,2477,2489,2495,2527,2531,2533,2534,2536,2537,2548,2549,2551,2559,2566,2572,2577,2578,2584,2587,2593,2600,2601,2608,2616,2617,2618,2656,2662,2677,2678,2683,2701,2732,2750,2752,2755,2763,2765,2772,2824,2848,2849,2850,2851,2852,2853,2854,2861,2862,2863,2864,2865,2866,2868,2869,2873,2953,2966,2967,3404,3408,3422,3474,3502,3524,3582,3604,3619,3682,3733,3771,3807,3832,3974,4020,4071,4090,4124,4139,4159,4189,4220,4243,4274,4304,4336,4363,4438,4460,4498,4508,4542,4561,4587,4629,4679,4705,4774,4775,4777,4800,4823,4859,4890,4907,4964,4977,5001,5030,5032,5066,5082,5110,5415,5424,5433,5440,5457,5461,5467,5506,5508,5515,5522,5531,5538,5539,5540,5552,5555,5570,5571,5580,5581,5590,5599,5605,5607,5608,5609,5646,5647,5649,5657,5664,5677,5681,5683,5684,5690,5697,5711,5721,5726,5734,5742,5748,5749,5753,5755,5756,5768,5840,5841,5842,5843,5845,5846,5849,5851,5854,5858,5859,5860,5866,5867,5868,5870,5872,5874,5875,5876,5879,5881,5884,5885,5887,6085,6092,6093,6094,6104,6109,6126,6140,6149,6150,6151,6155,6156,6158,6160,6166,6167,6170,6171,6173,6174,6175,7075,7078,7082,7100,7109,7112,7119,7120,7122,7123,7124,7126,7178,7179,7182,7183,7300,7301,7312,7323,7330,7333,7342,7343,7344,7359,7414,7605,7607,7608,7610,7615,7628,7643,7650,7659,7662,7665,7672,7680,7684,7685,7686,7700,7704,7713,7714,7715,7719,7754,7755,7772,7779,7787,7788,7793,7801,7845,7846,7852,7855,7866,7871,7872,7875,7877,7912,7913,7919,7926,7927,7936,7945,7960,7964,8016,8017,8022,8024,8027,8029,8030,8031,8040,8054,8062,8076,8088,8089,8091,8093,8115,8126,8132,8133,8145,8157,8244,8256,8264,8267,8273,8298,8301,8302,8303,8305,8308,8311,8322,8324,8326,8354,8428,8435,8439,8440,8449,8471,8472,8477,8478,8557,8559,8561,8570,8574,8580,8586,8592,8602,8607,8608,8626,8637,8642,8647,8657,8663,8667,8673,8679,10288,10289,10290,10297,10299]);
export const edgeLength = /*#__PURE__*/ new Uint8Array([3,3,3,3,3,3,3,3,5,8,8,2,2,3,3,3,3,3,8,5,5,5,5,5,3,3,5,5,9,12,19,8,19,8,11,9,9,8,7,7,6,8,9,16,10,7,7,11,8,6,6,9,7,11,7,14,4,4,4,4,4,4,10,7,6,6,6,6,10,10,6,10,10,22,11,9,10,10,10,9,10,8,7,7,7,8,21,13,11,11,9,10,9,13,10,8,8,9,12,9,7,10,7,7,13,7,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,8,6,3,3,3,3,3,3,2,5,3,3,3,7,2,2,2,2,2,2,3,3,3,1,1,7,8,5,2,2,7,2,2,1,4,1,11,9,9,5,5,8,5,5,5,5,5,5,5,3,3,3,3,3,5,11,9,9,13,7,14,7,6,6,6,7,6,6,6,6,6,10,7,11,9,4,4,4,4,4,6,6,6,6,13,6,8,7,10,9,9,9,8,9,8,7,10,6,9,8,10,10,7,8,1,9,10,12,12,12,10,9,9,10,10,9,9,1,1,5,3,3,3,3,3,3,3,3,3,3,3,3,6,6,6,4,3,3,3,7,4,4,4,3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,13,7,8,7,11,8,8,6,9,8,8,6,6,6,8,8,6,6,6,6,6,9,7,6,4,4,4,4,4,4,4,6,6,6,9,7,8,10,8,8,2,3,3,3,3,3,2,8,9,9,2,2,2,3,3,3,2,3,3,3,9,2,2,3,3,3,3,3,3,5,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,12,5,5,3,5,4,2,3,2,4,3,9,2,2,2,2,2,5,5,3,8,8,13,6,10,9,4,7,9,11,2,3,7,3,3,4,1,3,4,2,9,3,3,12,5,3,7,10,10,7,4,4,6,14,7,9,7,13,2,2,2,2,2,2,3,3,3,3,3,8,15,4,4,2,3,3,3,7,4,9,9,2,3,3,3,5,3,2,2,7,2,7,6,6,7,2,4,2,2,2,2,2,2,8,8,8,9,5,2,3,3,3,3,3,3,10,7,4,4,4,4,3,4,2,3,3,3,3,3,10,7,4,4,4,4,2,3,3,3,3,10,7,4,4,4,4,3,9,6,6,6,9,13,9,2,2,2,8,7,9,5,3,3,3,5,5,13,12,9,10,7,8,7,6,8,6,11,12,7,9,10,4,4,7,8,11,6,7,9,8,7,10,8,9,15,7,8,5,4,7,2,3,3,3,2,14,10,2,14,10,2,14,3,9,13,13,10,14,16,17,11,2,14,2,14,3,9,13,10,14,16,17,11,14,10,14,2,7,3,10,7,14,10,2,14,10,9,9,17,6,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,10,10,10,12,9,4,10,10,11,8,8,8,7,9,5,3,3,3,3,3,3,3,3,5,8,4,4,4,4,4,4,6,16,3,3,14,3,14,2,14,9,13,10,10,14,16,17,11,6,9,10,10,12,14,14,14,12,12,12,12,14,14,10,10,10,10,14,9,9,9,10,14,14,14,9,9,9,9,9,9,2,14,9,13,10,10,14,16,17,11,6,2,14,9,17,13,10,10,14,16,17,11,6,2,14,9,13,10,14,16,17,11,2,14,9,13,10,16,11,2,14,10,19,7,2,14,9,13,10,19,10,7,14,16,17,11,6,2,14,9,13,10,19,7,14,16,17,11,2,14,9,13,17,13,10,10,14,16,17,11,6,3,2,14,9,13,10,10,14,16,17,11,6,9,10,12,14,14,14,12,12,12,12,12,14,14,14,10,10,10,14,9,9,9,9,14,14,14,13,13,14,9,9,9,9,9,9,4,11,2,14,9,13,17,13,10,19,10,7,14,16,17,11,6,2,14,9,13,17,13,10,19,10,7,14,16,17,11,6,2,9,10,10,7,17,3,3,12,12,16,15,15,12,14,14,14,20,20,13,12,12,12,12,12,12,20,25,14,14,12,12,10,10,10,10,9,9,9,25,4,9,17,10,7,14,16,21,13,13,14,20,14,13,17,24,9,12,13,25,13,21,20,17,9,9,9,9,9,9,12,17,4,4,9,9,9,10,10,12,14,14,14,12,12,12,12,12,14,14,10,10,10,10,14,9,9,9,10,14,14,14,13,13,9,9,9,9,9,9,1,5,8,7,11,11,1,3,3,3,4,8,9,10,14,14,12,12,12,12,14,14,10,10,10,10,14,9,9,9,10,14,14,14,13,13,9,9,9,9,9,7,4,4,4,4,4,4,4,4,4,4,9,12,6,14,4,12,7,2,2,1,2,7,6,4,4,4,6,8,8,7,4,5,6,3,3,3,3,4,16,8,5,4,3,3,3,5,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,11,12,7,7,13,9,10,17,12,8,9,7,8,5,12,10,13,14,5,5,5,13,5,5,5,3,3,3,5,16,5,5,5,5,7,12,14,8,12,8,10,12,9,11,7,9,7,10,7,13,9,7,12,8,17,7,7,16,10,13,13,8,10,10,14,17,7,16,16,15,8,10,10,12,17,17,7,17,14,7,10,17,8,7,7,7,8,15,15,7,14,10,10,10,11,11,7,7,13,8,10,7,16,7,8,7,14,17,12,10,11,21,8,9,7,13,9,8,13,6,12,7,6,13,10,10,10,8,18,9,17,13,10,12,6,13,6,11,8,13,10,13,18,13,11,13,8,16,7,10,8,16,12,10,8,8,14,11,8,15,8,8,7,7,12,7,8,9,14,15,8,9,10,9,15,7,8,8,12,13,9,10,15,15,13,7,10,10,20,7,6,9,6,6,14,11,14,11,12,9,10,16,16,12,7,11,28,8,11,10,7,21,8,7,9,4,4,4,17,7,8,6,9,6,6,13,6,6,6,6,18,20,14,8,11,12,9,10,13,15,19,8,9,12,7,10,16,12,9,9,9,14,12,11,9,12,11,18,9,9,9,10,7,7,16,8,9,7,13,12,10,18,7,8,11,7,7,8,8,13,7,7,7,11,15,13,11,7,8,15,11,7,8,18,14,13,18,15,10,12,12,9,7,11,11,8,7,10,8,14,12,10,18,7,10,9,7,8,13,10,14,10,8,8,23,7,7,11,12,12,17,7,7,11,11,17,16,16,7,8,11,14,14,8,10,7,7,16,16,13,9,11,9,15,15,11,11,7,7,14,7,9,7,7,16,10,13,10,11,14,7,11,10,11,7,11,10,11,15,11,15,10,12,17,10,14,13,11,11,12,13,10,7,13,10,16,12,21,9,10,10,7,11,14,17,7,7,8,11,12,8,15,14,14,8,17,12,10,10,7,9,11,7,10,7,11,18,7,11,7,12,11,8,8,14,12,7,8,15,3,7,7,5,2,9,2,2,2,2,2,2,2,3,3,3,3,3,3,3,2,5,3,3,3,3,3,3,4,4,3,3,3,3,3,3,5,11,6,4,7,10,7,7,11,1,10,2,2,3,3,3,3,3,3,3,3,5,7,3,5,6,3,3,5,2,2,5,3,4,13,11,3,3,Line truncated
export const edgeChild = /*#__PURE__*/ new Uint16Array([0,0,0,1,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,12,1,1,1,1,1,17,1,1,1,12,1,12,1,12,13,1,1,1,1,12,1,12,1,1,1,1,1,14,21,1,1,1,1,1,1,1,19,12,1,1,1,1,1,1,1,20,1,1,1,16,18,1,1,15,1,1,1,1,12,1,1,1,1,1,1,1,22,1,1,1,1,12,1,1,1,1,1,1,1,1,12,12,12,12,12,12,12,12,12,12,12,12,1,24,25,26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,12,12,12,12,1,32,0,0,0,1,1,1,1,35,34,1,1,1,1,1,33,1,1,1,1,37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,0,0,0,0,39,40,0,0,0,0,12,1,1,12,1,1,1,1,43,44,44,44,43,44,43,43,45,44,43,44,43,43,43,43,43,43,45,43,43,43,43,43,43,44,46,46,44,43,43,43,43,43,12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,49,51,49,49,49,51,49,50,49,52,49,50,50,49,49,49,50,52,50,52,49,50,50,12,54,54,53,55,50,52,49,49,47,48,56,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,59,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,66,1,12,1,1,65,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,77,0,0,0,0,0,0,0,0,0,0,0,0,0,75,78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,12,1,1,1,1,88,1,90,1,1,1,1,1,1,1,1,93,1,1,1,1,1,1,1,1,1,1,1,1,0,1,96,96,1,1,12,1,99,1,1,1,1,1,1,1,97,1,98,1,100,1,1,1,1,1,101,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,109,110,1,1,1,1,1,1,112,112,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,120,121,1,1,1,1,1,1,1,1,1,1,1,1,1,121,1,1,1,1,1,1,1,1,1,1,121,1,1,1,1,1,1,1,1,1,125,122,124,119,1,123,1,1,113,1,1,1,1,116,1,126,1,1,1,1,1,1,118,1,107,1,108,1,12,127,105,1,111,1,1,1,1,1,106,114,1,12,12,12,117,115,1,1,1,1,1,1,0,0,0,0,1,12,12,1,1,1,1,1,12,133,1,1,1,1,1,1,1,1,1,1,1,12,135,1,1,1,1,1,1,1,1,136,137,12,12,134,132,44,44,139,49,49,138,141,140,1,1,0,0,0,0,0,0,0,0,0,0,0,0,144,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,142,0,0,0,0,1,0,143,131,1,0,1,1,12,12,1,1,1,1,1,0,0,0,0,0,0,0,1,147,146,20,1,1,12,12,1,20,12,12,1,1,1,1,1,133,1,1,151,1,1,1,1,152,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,1,135,1,1,151,1,1,1,1,152,1,1,133,1,1,1,151,1,1,1,1,152,1,1,133,1,1,1,1,1,1,1,1,133,1,1,1,1,1,1,1,1,1,1,1,159,1,1,1,151,1,1,1,1,1,152,1,1,159,1,1,1,1,1,1,1,1,1,1,133,1,1,1,1,151,1,1,1,1,152,1,1,1,133,1,1,151,1,1,1,1,163,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,1,166,1,1,159,1,1,1,1,1,151,1,1,1,1,1,152,1,1,159,1,1,1,1,1,151,1,1,1,1,1,152,1,153,157,157,12,1,12,165,1,1,1,1,1,157,157,157,153,1,1,1,156,157,160,164,1,1,1,1,156,156,1,1,155,153,153,156,169,155,169,1,1,167,1,155,154,156,1,1,1,1,156,1,158,1,1,1,12,1,161,1,161,1,1,1,161,160,162,168,155,153,1,1,1,1,1,1,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,172,171,172,171,171,171,171,173,173,171,172,171,172,171,171,12,1,12,12,12,12,1,12,12,12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,193,1,1,1,1,12,199,200,201,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,12,1,1,1,1,1,1,1,1,150,1,1,1,1,1,1,1,1,1,1,1,196,1,1,1,184,1,1,1,1,207,1,1,204,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,12,1,1,1,1,1,12,1,1,1,1,1,1,1,1,176,190,1,1,1,186,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,182,1,1,1,1,1,1,1,191,1,1,1,1,195,1,1,1,1,170,1,1,189,1,1,1,192,1,1,1,12,1,1,1,1,1,1,1,1,1,1,1,1,180,1,12,1,1,12,1,1,1,1,183,1,1,1,188,1,12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,12,1,1,208,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,194,1,1,1,1,1,12,1,1,1,1,1,1,1,1,175,12,1,1,1,178,12,1,1,1,1,1,1,1,198,1,1,1,1,1,1,1,1,1,1,177,1,1,1,1,1,1,203,1,1,1,181,1,1,1,187,1,12,1,1,12,1,1,1,1,1,1,1,1,1,1,191,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,174,1,1,1,1,1,1,1,1,1,1,185,1,1,1,1,1,1,1,1,1,1,1,205,1,1,1,1,1,1,1,1,1,1,12,1,206,1,1,12,1,1,1,1,179,1,1,1,185,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,12,1,1,1,197,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,12,12,1,1,1,1,1,1,1,1,1,202,1,1,12,1,1,1,12,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,218,0,0,0,0,0,219,0,0,0,0,0,0,1,12,1,1,1,223,1,1,1,0,224,221,222,1,1,1,1,1,1,229,1,231,1,1,1,1,1,1,1,1,1,1,1,227,1,1,1,1,1,233,1,1,1Line truncated
export const labelText = "orgmilcomschnetedugovdrrformsfeedbackofficialaccoorgmilschnetgovmagazinemediaunioncargopilotgroupcaarespressworksaerodromeworkinggroupair-traffic-controlaircraftaccident-preventioneducatormarketplaceambulanceinsurancecateringairportrepbodyenginesoftwaremodellingair-surveillanceconsultingchartertrainermaintenanceservicesdesignflightskydivingfreightassociationstudentgroundhandlingdgcafuelclubtaxicrewshowballooningexpresstraderbrokerauthoragentsairtrafficjournalistsafetyconsultantmicrolightaccident-investigationparachutingequipmentproductionfederationrecreationscientistnavigationengineertradingglidingleasingresearchpassenger-associationentertainmentparaglidinghangglidingaerobaticrotorcraftemergencycertificationgovernmentaeroclubexchangelogisticschampionshiphomebuiltcouncilconferencecontrolairlinecivilaviationjournalorgcomnetedugovcoorgcomnomnetobjofforgcomnetuwukiloappsframerorgmilcomnetedugovcoradioorgcomnetcommuneedogpbcoitgvorgedugov*spreviewfrontendrelayononstagingupid*mtls*privatelinktypedreamdeveloperbravemochawindsurfaivenmirenupsunwnextbegetngrokclerkwale2bwebcsbrunputerflutterflowspawnbaseshiptodaymagicpatternsnetlifyondigitaloceanrailwayhostedclaudehasurabotdashvercelgithubluyanigadgetreplitcloudflaretelebitedgecomputeevervaultexponyatnoopencrpplxzeaburwasmerframerzeropsrocketpreviewconvexmedusajsspritesonherculeseasypanelstreamlitsnowflakemesserliloginlinehackclubcodepennorthflankbase44corespeedleapcellngrok-freeclerkstagelovableon-fleek*us-west-3ap-south-2us-central-2us-central-1eu-central-1ap-south-1us-west-2us-east-2eu-north-1ap-north-1us-west-1us-east-1*rcloudintsegorgmilcomgobbetnetintedugovturmusicasenasamutualcoopip6uriurnin-addre164homeirisgovdixdaemoncloudnssthwien*inexexkunden4accogvormymyspreadshop4lima2ixortsinfofuturecmsfuturehosting12hpprivfuturemailinglima-cityfunkfeuer123webseitednshomemelmyspreadshopcloudletswasantqldvicactnswtascatholicwasaqldvictasidwasantozqldorgcomvicasnactnetedugovnswtasconfcomairflowlambda-urltransfer-webappairflowtransfer-webapptransfer-webapptransfer-webapp-fipstransfer-webappeu-west-3ap-south-2eu-south-2eu-central-2ap-southeast-3ap-southeast-4ap-northeast-3eu-central-1mx-central-1me-central-1ca-central-1il-central-1ap-northeast-1ap-southeast-1me-south-1af-south-1eu-south-1ap-south-1ap-southeast-7us-west-2eu-west-2us-east-2eu-north-1ap-southeast-2ap-northeast-2ap-southeast-5us-gov-west-1us-gov-east-1ca-west-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1privatenotebookstudiolabelingnotebookstudionotebooknotebook-fipslabelingnotebookstudionotebook-fipsnotebookstudio-fipsnotebook-fipsnotebookstudionotebook-fipsnotebookstudioeu-west-3ap-south-2eu-south-2eu-central-2ap-southeast-3ap-southeast-4ap-northeast-3eu-central-1me-central-1ca-central-1il-central-1ap-northeast-1ap-southeast-1me-south-1af-south-1eu-south-1ap-south-1us-west-2eu-west-2us-east-2eu-north-1ap-southeast-2ap-northeast-2experimentsus-gov-west-1us-gov-east-1ca-west-1us-west-1eu-west-1us-east-1ap-east-1sa-east-1onrepostsagemakercopporgmilcompronetintedugovbiznameinfoshoprsorgmilcomnetedugovbrendlyresolvenzauscotvstoreorgcomnetedugovbizinfoidacaicoittvorgmilcomschnetedugovinfocloudezproxyacmymyspreadshopkuleuvenwebhostingtransurl123websitecloudnsinterhostsolutionsddns5476103298edgfacbmlonihkjutwvqpsryxzbarsycoororgcomedumyftpno-iporxcloud-ipfor-somemmafanfor-morewebhopselfipjozidyndnscloudnsdscloudfor-thefor-betteractivetrailcoeconorestooteorgcomeconeteduassurmoneyafricaarchitectesrestaurantloisirstourismavocatsinfoagrounivcoorgcomnetedugoviatvdeportesaludtksatorgmilcomwebgobnetinteducienciaboliviarevistacooperativaempresanombreindustriamusicapatriamedicinademocraciapoliticapuebloindigenaplurinacionalarteblogwikiinfoagrotransportenoticiasprofesionalacademiaeconomiaecologiamovimientotecnologianaturalsimplesitecepesebamapadfmgalampbacscpirngorotomtrjspaprrprrsesmscepesebamapadfmgalampbacscpirngorotomtrjspaprrprrsesms*biaamfmtcmptvfeirasampajampanatalbelemananiradiog12medindfndbmdtrdthepoaggfjdfdefinfenflegsegongengcngorgzlgslglogppgmillelqslcimcomnomadmjabimbbibbsbabcrectecsjcetcpscpvhudieticriapipsiecnbiorioecogeoteoodoproatoartfstmatvetdetbetnetcntnotfotgrueduajuespappreptmpemparqsrvadvdevgovntrturagrjorfarjusmusdesvixxyzcozfozslzbhzmaringasantamariacampinagrandegoianiasorocabafloripasaobernardocuritibaboavistarecifeaparecidasaogoncasalvadorcuiabamorenamacapalondrinacontagemsocialfortalmaceioleilaoosascoriobranconiteroi9guacutcheblogflogvlogwikitaxicoopmanauspalmascaxiasjoinvillebaruericampinassantoandreribeiraoriopretoweorgcomnetedugovv0windsurfshiptodaycloudsitecoaccoorgnetgovofmilcomgovmediatechzacoorgcomnetedugsjgovmydnspenfnlabnbmbgcbcqconcontnuyksknsmyspreadshopno-ipawdevboxbarsyonidatemfuinabusavinstanceseceuguukussryzespawncsxcloud-ipmyphotosfantasyleaguetwmailcleverappsscrappingccwucloudnsftpaccessgame-serverccgovobjectsrmalpgcust*svcalp1aeappenginermalpgmyspreadshop4lima2ixsquare7cloudscale123websitefirenet12hpflowgotdnslinkyard-cloudcloudnslima-citydnskingobjectstLine truncated
export const rulesRoot = 620;
export const exceptionsRoot = 624;
+207
View File
@@ -0,0 +1,207 @@
// NOTE: kept (intentionally) near-identical to packages/tldts-icann/src/suffix-trie.ts.
// They are separate copies rather than a shared helper because the lookup is
// only fast when the typed arrays are module-scope monomorphic globals —
// closing over them (a shared factory) measured ~20% slower. The ICANN build
// also specializes (constant mask, no isIcann/isPrivate). Keep the two in sync.
import {
fastPathLookup,
IPublicSuffix,
ISuffixLookupOptions,
} from 'tldts-core';
import {
edgeChild,
edgeLength,
edgeStart,
exceptionsRoot,
labelText,
nodeFlags,
rulesRoot,
} from './data/trie';
const enum RULE_TYPE {
ICANN = 1,
PRIVATE = 2,
}
// `edgeOffset` (where each label starts in `labelText`), `edgeHash` (djb2 of
// each label) and `wildcardEdge` (each node's '*' edge, or -1) are derived once
// at load instead of being shipped: the bundle then carries only the
// compressible `labelText` + structure, while the lookup binary-searches
// integer hashes. The cost is a single ~1ms pass at first import — cheaper than
// the object trie it replaces. Kept at module scope (not captured in a closure)
// so V8 treats the typed arrays as fast monomorphic globals.
const numberOfNodes = nodeFlags.length;
const numberOfEdges = edgeLength.length;
const edgeOffset = new Uint32Array(numberOfEdges);
const edgeHash = new Uint32Array(numberOfEdges);
const wildcardEdge = new Int32Array(numberOfNodes).fill(-1);
for (let node = 0, offset = 0; node < numberOfNodes; node += 1) {
for (let edge = edgeStart[node]!; edge < edgeStart[node + 1]!; edge += 1) {
edgeOffset[edge] = offset;
const end = offset + edgeLength[edge]!;
let hash = 5381;
for (let i = end - 1; i >= offset; i -= 1) {
hash = (hash * 33) ^ labelText.charCodeAt(i);
}
edgeHash[edge] = hash >>> 0;
if (
edgeLength[edge] === 1 &&
labelText.charCodeAt(offset) === 42 /* '*' */
) {
wildcardEdge[node] = edge;
}
offset = end;
}
}
// Result of the last `walk`, kept in module scope to avoid allocating a match
// object. Safe because lookups are synchronous and read right after `walk`.
let matchNode = -1;
let matchStart = 0;
let matchEnd = 0;
/**
* True if edge `edge`'s label equals `hostname[start, start + length)`.
*/
function labelEquals(
edge: number,
hostname: string,
start: number,
length: number,
): boolean {
if (edgeLength[edge] !== length) {
return false;
}
const offset = edgeOffset[edge]!;
for (let i = 0; i < length; i += 1) {
if (labelText.charCodeAt(offset + i) !== hostname.charCodeAt(start + i)) {
return false;
}
}
return true;
}
/**
* Find the child edge of `node` whose label is `hostname[start, start + length)`.
* Edges are sorted by hash, so binary-search the hash then verify the label
* (scanning the rare run of equal hashes). Returns the edge index or -1.
*/
function findEdge(
node: number,
hash: number,
hostname: string,
start: number,
length: number,
): number {
let lo = edgeStart[node]!;
let hi = edgeStart[node + 1]!;
while (lo < hi) {
const mid = (lo + hi) >>> 1;
const value = edgeHash[mid]!;
if (value < hash) {
lo = mid + 1;
} else if (value > hash) {
hi = mid;
} else {
for (let e = mid; e >= lo && edgeHash[e] === hash; e -= 1) {
if (labelEquals(e, hostname, start, length)) return e;
}
for (let e = mid + 1; e < hi && edgeHash[e] === hash; e += 1) {
if (labelEquals(e, hostname, start, length)) return e;
}
return -1;
}
}
return -1;
}
/**
* Walk `hostname`'s labels right-to-left from `root`, recording the deepest
* node whose flag passes `allowedMask` (with the label boundaries of that match
* in `matchStart`/`matchEnd`). Returns whether any match was found.
*/
function walk(hostname: string, root: number, allowedMask: number): boolean {
let node = root;
let end = hostname.length;
let hash = 5381;
matchNode = -1;
for (let i = hostname.length - 1; i >= 0; i -= 1) {
const code = hostname.charCodeAt(i);
if (code === 46 /* '.' */) {
const start = i + 1;
let edge = findEdge(node, hash >>> 0, hostname, start, end - start);
if (edge === -1) {
edge = wildcardEdge[node]!;
}
if (edge === -1) {
return matchNode !== -1;
}
node = edgeChild[edge]!;
if ((nodeFlags[node]! & allowedMask) !== 0) {
matchNode = node;
matchStart = start;
matchEnd = end;
}
end = i;
hash = 5381;
} else {
hash = (hash * 33) ^ code;
}
}
// Left-most label: hostname[0, end). Same find/descend/record as the loop —
// duplicated rather than folded into the loop (via `i >= -1`) because that
// extra per-character branch measured slightly slower on the hot path.
let edge = findEdge(node, hash >>> 0, hostname, 0, end);
if (edge === -1) {
edge = wildcardEdge[node]!;
}
if (edge !== -1) {
node = edgeChild[edge]!;
if ((nodeFlags[node]! & allowedMask) !== 0) {
matchNode = node;
matchStart = 0;
matchEnd = end;
}
}
return matchNode !== -1;
}
/**
* Check if `hostname` has a valid public suffix in the trie.
*/
export default function suffixLookup(
hostname: string,
options: ISuffixLookupOptions,
out: IPublicSuffix,
): void {
if (fastPathLookup(hostname, options, out)) {
return;
}
const allowedMask =
(options.allowPrivateDomains ? RULE_TYPE.PRIVATE : 0) |
(options.allowIcannDomains ? RULE_TYPE.ICANN : 0);
// Exceptions have priority and strip their own left-most label (e.g. the
// rule '!www.ck' makes the suffix of 'www.ck' be 'ck').
if (walk(hostname, exceptionsRoot, allowedMask)) {
out.isIcann = (nodeFlags[matchNode]! & RULE_TYPE.ICANN) !== 0;
out.isPrivate = (nodeFlags[matchNode]! & RULE_TYPE.PRIVATE) !== 0;
out.publicSuffix = hostname.slice(matchEnd + 1);
return;
}
if (walk(hostname, rulesRoot, allowedMask)) {
out.isIcann = (nodeFlags[matchNode]! & RULE_TYPE.ICANN) !== 0;
out.isPrivate = (nodeFlags[matchNode]! & RULE_TYPE.PRIVATE) !== 0;
out.publicSuffix = hostname.slice(matchStart);
return;
}
// No match: the prevailing '*' rule makes the right-most label the suffix.
out.isIcann = false;
out.isPrivate = false;
const lastDot = hostname.lastIndexOf('.');
out.publicSuffix = lastDot === -1 ? hostname : hostname.slice(lastDot + 1);
}