tldts-experimental 7.5.0 → 7.5.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tldts-experimental",
3
- "version": "7.5.0",
3
+ "version": "7.5.1",
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.5.0",
64
+ "tldts-tests": "^7.5.1",
65
65
  "typescript": "^6.0.3"
66
66
  },
67
67
  "dependencies": {
68
- "tldts-core": "^7.5.0"
68
+ "tldts-core": "^7.5.1"
69
69
  },
70
70
  "keywords": [
71
71
  "tld",
@@ -82,5 +82,5 @@
82
82
  "url parsing",
83
83
  "typescript"
84
84
  ],
85
- "gitHead": "dabe7630d2b1e9c5cb55e6d0a3f5e0abc9058a59"
85
+ "gitHead": "53e0057d69985c6217e4518a3e915bd223044e66"
86
86
  }
@@ -231,6 +231,14 @@ export default function suffixLookup(
231
231
  // important to make sure that we always keep the longest match if there
232
232
  // are both a wildcard and a normal rule matching).
233
233
  if (match !== Result.NO_MATCH) {
234
+ // '*' never matches an empty label ('.S', '..S'): `*.S` then only
235
+ // implies `S`.
236
+ if (
237
+ (match & Result.WILDCARD_MATCH) !== 0 &&
238
+ (labelStart === 1 || hostname.charCodeAt(labelStart - 2) === 46)
239
+ ) {
240
+ match = (match & ~Result.WILDCARD_MATCH) | Result.NORMAL_MATCH;
241
+ }
234
242
  matchKind = match;
235
243
  matchLabels = label + ((match & Result.WILDCARD_MATCH) !== 0 ? 2 : 1);
236
244
  matchIndex = labelStart;