@jsenv/filesystem 4.10.1 → 4.10.3
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": "@jsenv/filesystem",
|
|
3
|
-
"version": "4.10.
|
|
3
|
+
"version": "4.10.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,12 +28,9 @@
|
|
|
28
28
|
"files": [
|
|
29
29
|
"/src/"
|
|
30
30
|
],
|
|
31
|
-
"scripts": {
|
|
32
|
-
"test": "node --conditions=development ./scripts/test.mjs"
|
|
33
|
-
},
|
|
34
31
|
"dependencies": {
|
|
35
32
|
"@jsenv/urls": "2.5.2",
|
|
36
|
-
"@jsenv/url-meta": "8.5.
|
|
33
|
+
"@jsenv/url-meta": "8.5.2",
|
|
37
34
|
"@jsenv/abort": "4.3.0",
|
|
38
35
|
"@jsenv/utils": "2.1.2"
|
|
39
36
|
}
|
|
@@ -15,7 +15,7 @@ export const validateDirectoryUrl = (value) => {
|
|
|
15
15
|
} else {
|
|
16
16
|
try {
|
|
17
17
|
urlString = String(new URL(value));
|
|
18
|
-
} catch
|
|
18
|
+
} catch {
|
|
19
19
|
return {
|
|
20
20
|
valid: false,
|
|
21
21
|
value,
|
|
@@ -23,6 +23,12 @@ export const validateDirectoryUrl = (value) => {
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
+
} else if (
|
|
27
|
+
value &&
|
|
28
|
+
typeof value === "object" &&
|
|
29
|
+
typeof value.href === "string"
|
|
30
|
+
) {
|
|
31
|
+
value = value.href;
|
|
26
32
|
} else {
|
|
27
33
|
return {
|
|
28
34
|
valid: false,
|
|
@@ -19,7 +19,7 @@ const baseUrlFallback = fileSystemPathToUrl(process.cwd());
|
|
|
19
19
|
export const ensureWindowsDriveLetter = (url, baseUrl) => {
|
|
20
20
|
try {
|
|
21
21
|
url = String(new URL(url));
|
|
22
|
-
} catch
|
|
22
|
+
} catch {
|
|
23
23
|
throw new Error(`absolute url expect but got ${url}`);
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -29,7 +29,7 @@ export const ensureWindowsDriveLetter = (url, baseUrl) => {
|
|
|
29
29
|
|
|
30
30
|
try {
|
|
31
31
|
baseUrl = String(new URL(baseUrl));
|
|
32
|
-
} catch
|
|
32
|
+
} catch {
|
|
33
33
|
throw new Error(
|
|
34
34
|
`absolute baseUrl expect but got ${baseUrl} to ensure windows drive letter on ${url}`,
|
|
35
35
|
);
|