@jsenv/test 3.3.10 → 3.3.11
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/jsenv_test.js +18 -10
- package/package.json +7 -7
package/dist/jsenv_test.js
CHANGED
|
@@ -1676,18 +1676,26 @@ const pathnameToExtension = (pathname) => {
|
|
|
1676
1676
|
};
|
|
1677
1677
|
|
|
1678
1678
|
const ensurePathnameTrailingSlash = (url) => {
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1679
|
+
if (typeof url === "string") {
|
|
1680
|
+
const urlObject = new URL(url);
|
|
1681
|
+
const { pathname } = urlObject;
|
|
1682
|
+
if (pathname.endsWith("/")) {
|
|
1683
|
+
return url;
|
|
1684
|
+
}
|
|
1685
|
+
let { origin } = urlObject;
|
|
1686
|
+
// origin is "null" for "file://" urls with Node.js
|
|
1687
|
+
if (origin === "null" && urlObject.href.startsWith("file:")) {
|
|
1688
|
+
origin = "file://";
|
|
1689
|
+
}
|
|
1690
|
+
const { search, hash } = urlObject;
|
|
1691
|
+
const urlWithTrailingSlash = `${origin}${pathname}/${search}${hash}`;
|
|
1692
|
+
return urlWithTrailingSlash;
|
|
1693
|
+
}
|
|
1694
|
+
if (url.pathname.endsWith("/")) {
|
|
1682
1695
|
return url;
|
|
1683
1696
|
}
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
if (origin === "null" && urlObject.href.startsWith("file:")) {
|
|
1687
|
-
origin = "file://";
|
|
1688
|
-
}
|
|
1689
|
-
const { search, hash } = urlObject;
|
|
1690
|
-
return `${origin}${pathname}/${search}${hash}`;
|
|
1697
|
+
url.pathname += "/";
|
|
1698
|
+
return url;
|
|
1691
1699
|
};
|
|
1692
1700
|
|
|
1693
1701
|
const isFileSystemPath = (value) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/test",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.11",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -38,14 +38,14 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@c88/v8-coverage": "0.1.1",
|
|
40
40
|
"@jsenv/abort": "4.3.0",
|
|
41
|
-
"@jsenv/ast": "6.2.
|
|
42
|
-
"@jsenv/filesystem": "4.8.
|
|
43
|
-
"@jsenv/github-check-run": "0.1.
|
|
41
|
+
"@jsenv/ast": "6.2.3",
|
|
42
|
+
"@jsenv/filesystem": "4.8.1",
|
|
43
|
+
"@jsenv/github-check-run": "0.1.22",
|
|
44
44
|
"@jsenv/humanize": "1.2.4",
|
|
45
|
-
"@jsenv/plugin-supervisor": "1.5.
|
|
46
|
-
"@jsenv/sourcemap": "1.2.
|
|
45
|
+
"@jsenv/plugin-supervisor": "1.5.4",
|
|
46
|
+
"@jsenv/sourcemap": "1.2.15",
|
|
47
47
|
"@jsenv/url-meta": "8.4.2",
|
|
48
|
-
"@jsenv/urls": "2.
|
|
48
|
+
"@jsenv/urls": "2.3.0",
|
|
49
49
|
"@jsenv/utils": "2.1.1",
|
|
50
50
|
"errorstacks": "2.4.1",
|
|
51
51
|
"he": "1.2.0",
|