@cspell/url 8.17.5 → 8.18.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/dist/index.js +2 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -10,9 +10,9 @@ function urlParent(url) {
|
|
|
10
10
|
}
|
|
11
11
|
const hasTrailingSlash = url.pathname.endsWith("/");
|
|
12
12
|
if (!url.pathname.startsWith("/")) {
|
|
13
|
+
if (!url.pathname) return url;
|
|
13
14
|
const parts = url.pathname.split("/").slice(0, hasTrailingSlash ? -2 : -1);
|
|
14
|
-
|
|
15
|
-
pathname = pathname && pathname + "/" || "";
|
|
15
|
+
const pathname = parts.join("/") + "/";
|
|
16
16
|
return new URL(url.protocol + (url.host ? "//" + url.host : "") + pathname + url.search + url.hash);
|
|
17
17
|
}
|
|
18
18
|
return new URL(hasTrailingSlash ? ".." : ".", url);
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public",
|
|
5
5
|
"provenance": true
|
|
6
6
|
},
|
|
7
|
-
"version": "8.
|
|
7
|
+
"version": "8.18.1",
|
|
8
8
|
"description": "URL parsing and manipulation utilities for cspell",
|
|
9
9
|
"keywords": [
|
|
10
10
|
"cspell",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": ">=18.0"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "4d647f52891c3300221ff9b2341b0474f68b30b5"
|
|
62
62
|
}
|