tldts-experimental 7.4.27 → 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.
@@ -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): void;
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.4.27",
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.4.27",
64
+ "tldts-tests": "^7.5.0",
65
65
  "typescript": "^6.0.3"
66
66
  },
67
67
  "dependencies": {
68
- "tldts-core": "^7.4.27"
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": "41d7f499a05bbfb391e943931a607d19a0b03316"
85
+ "gitHead": "dabe7630d2b1e9c5cb55e6d0a3f5e0abc9058a59"
86
86
  }
@@ -103,9 +103,9 @@ export default function suffixLookup(
103
103
  hostname: string,
104
104
  options: ISuffixLookupOptions,
105
105
  out: IPublicSuffix,
106
- ): void {
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
  }