tldts-experimental 7.4.28 → 7.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/cjs/index.js +96 -8
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/src/packed-hashes.js +6 -5
- package/dist/cjs/src/packed-hashes.js.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/es6/src/packed-hashes.js +6 -5
- package/dist/es6/src/packed-hashes.js.map +1 -1
- package/dist/es6/tsconfig.bundle.tsbuildinfo +1 -1
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.cjs.min.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/types/src/packed-hashes.d.ts +1 -1
- package/package.json +4 -4
- package/src/packed-hashes.ts +7 -6
|
@@ -5,4 +5,4 @@ import { IPublicSuffix, ISuffixLookupOptions } from 'tldts-core';
|
|
|
5
5
|
* should be considered. By default, both are.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
export default function suffixLookup(hostname: string, options: ISuffixLookupOptions, out: IPublicSuffix):
|
|
8
|
+
export default function suffixLookup(hostname: string, options: ISuffixLookupOptions, out: IPublicSuffix): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tldts-experimental",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.5.0",
|
|
4
4
|
"description": "Library to work against complex domain names, subdomains and URIs.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Rémi Berson"
|
|
@@ -61,11 +61,11 @@
|
|
|
61
61
|
"rimraf": "^6.1.2",
|
|
62
62
|
"rollup": "^4.63.4",
|
|
63
63
|
"rollup-plugin-sourcemaps2": "^0.5.8",
|
|
64
|
-
"tldts-tests": "^7.
|
|
64
|
+
"tldts-tests": "^7.5.0",
|
|
65
65
|
"typescript": "^6.0.3"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"tldts-core": "^7.
|
|
68
|
+
"tldts-core": "^7.5.0"
|
|
69
69
|
},
|
|
70
70
|
"keywords": [
|
|
71
71
|
"tld",
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"url parsing",
|
|
83
83
|
"typescript"
|
|
84
84
|
],
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "dabe7630d2b1e9c5cb55e6d0a3f5e0abc9058a59"
|
|
86
86
|
}
|
package/src/packed-hashes.ts
CHANGED
|
@@ -103,9 +103,9 @@ export default function suffixLookup(
|
|
|
103
103
|
hostname: string,
|
|
104
104
|
options: ISuffixLookupOptions,
|
|
105
105
|
out: IPublicSuffix,
|
|
106
|
-
):
|
|
106
|
+
): boolean {
|
|
107
107
|
if (fastPathLookup(hostname, options, out)) {
|
|
108
|
-
return;
|
|
108
|
+
return false;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
const { allowIcannDomains, allowPrivateDomains } = options;
|
|
@@ -244,7 +244,7 @@ export default function suffixLookup(
|
|
|
244
244
|
if (matchIndex === -1) {
|
|
245
245
|
out.publicSuffix =
|
|
246
246
|
numberOfHashes === 1 ? hostname : hostname.slice(BUFFER[1]);
|
|
247
|
-
return;
|
|
247
|
+
return false;
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
// If match is an exception, this means that we need to count less label.
|
|
@@ -252,7 +252,7 @@ export default function suffixLookup(
|
|
|
252
252
|
// to locate the next dot and slice from there.
|
|
253
253
|
if ((matchKind & Result.EXCEPTION_MATCH) !== 0) {
|
|
254
254
|
out.publicSuffix = hostname.slice(BUFFER[((matchLabels - 2) << 1) + 1]);
|
|
255
|
-
return;
|
|
255
|
+
return true;
|
|
256
256
|
}
|
|
257
257
|
|
|
258
258
|
// If match is a wildcard, we need to match one more label. If wildcard rule
|
|
@@ -261,7 +261,7 @@ export default function suffixLookup(
|
|
|
261
261
|
if ((matchKind & Result.WILDCARD_MATCH) !== 0) {
|
|
262
262
|
if (matchLabels < numberOfHashes) {
|
|
263
263
|
out.publicSuffix = hostname.slice(BUFFER[((matchLabels - 1) << 1) + 1]);
|
|
264
|
-
return;
|
|
264
|
+
return false;
|
|
265
265
|
}
|
|
266
266
|
|
|
267
267
|
// matchLabels >= numberOfHashes: the suffix may extend past the labels we
|
|
@@ -280,10 +280,11 @@ export default function suffixLookup(
|
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
out.publicSuffix = hostname.slice(suffixStart);
|
|
283
|
-
return;
|
|
283
|
+
return false;
|
|
284
284
|
}
|
|
285
285
|
|
|
286
286
|
// if ((matchKind & Result.NORMAL_MATCH) !== 0)
|
|
287
287
|
// For normal match, we just slice the hostname at the beginning of suffix.
|
|
288
288
|
out.publicSuffix = hostname.slice(matchIndex);
|
|
289
|
+
return false;
|
|
289
290
|
}
|