@veryfront/ext-content-mdx 0.1.1183 → 0.1.1185
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/esm/deno.d.ts +4 -1
- package/esm/deno.js +11 -6
- package/esm/src/extensions/websocket/index.d.ts +3 -0
- package/esm/src/extensions/websocket/index.d.ts.map +1 -0
- package/esm/src/extensions/websocket/index.js +2 -0
- package/esm/src/extensions/websocket/node-websocket-server-provider.d.ts +51 -0
- package/esm/src/extensions/websocket/node-websocket-server-provider.d.ts.map +1 -0
- package/esm/src/extensions/websocket/node-websocket-server-provider.js +146 -0
- package/esm/src/platform/adapters/base.d.ts +17 -0
- package/esm/src/platform/adapters/base.d.ts.map +1 -1
- package/esm/src/platform/adapters/base.js +54 -5
- package/esm/src/platform/compat/path/basic-operations.d.ts +1 -1
- package/esm/src/platform/compat/path/basic-operations.d.ts.map +1 -1
- package/esm/src/platform/compat/path/basic-operations.js +24 -44
- package/esm/src/platform/compat/path/index.d.ts +1 -0
- package/esm/src/platform/compat/path/index.d.ts.map +1 -1
- package/esm/src/platform/compat/path/index.js +1 -0
- package/esm/src/platform/compat/path/parse-format.d.ts.map +1 -1
- package/esm/src/platform/compat/path/parse-format.js +26 -20
- package/esm/src/platform/compat/path/portable.d.ts +16 -0
- package/esm/src/platform/compat/path/portable.d.ts.map +1 -0
- package/esm/src/platform/compat/path/portable.js +307 -0
- package/esm/src/platform/compat/path/posix.d.ts +14 -0
- package/esm/src/platform/compat/path/posix.d.ts.map +1 -0
- package/esm/src/platform/compat/path/posix.js +206 -0
- package/esm/src/platform/compat/path/resolution.d.ts +1 -1
- package/esm/src/platform/compat/path/resolution.d.ts.map +1 -1
- package/esm/src/platform/compat/path/resolution.js +28 -112
- package/esm/src/platform/compat/path/runtime.d.ts +2 -1
- package/esm/src/platform/compat/path/runtime.d.ts.map +1 -1
- package/esm/src/platform/compat/path/runtime.js +5 -0
- package/esm/src/platform/compat/path/types.d.ts +5 -1
- package/esm/src/platform/compat/path/types.d.ts.map +1 -1
- package/esm/src/platform/compat/path/url-conversion.d.ts +10 -0
- package/esm/src/platform/compat/path/url-conversion.d.ts.map +1 -1
- package/esm/src/platform/compat/path/url-conversion.js +63 -41
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +2 -2
|
@@ -1,121 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
function
|
|
4
|
-
return
|
|
1
|
+
import { hasWindowsLikePath, portableIsAbsolute, portableNormalize, portableRelative, portableResolve, removeTrailingSeparatorsExceptRoot, runtimeUsesWindowsPaths, toPortableSeparators, } from "./portable.js";
|
|
2
|
+
import { getNativePathImplementation } from "./runtime.js";
|
|
3
|
+
function usesWindowsFlavor(paths) {
|
|
4
|
+
return runtimeUsesWindowsPaths() || paths.some(hasWindowsLikePath);
|
|
5
5
|
}
|
|
6
|
-
/**
|
|
7
|
-
function normSep(p) {
|
|
8
|
-
return p.includes("\\") ? p.replace(/\\/g, "/") : p;
|
|
9
|
-
}
|
|
10
|
-
/** Match Windows drive letter prefix like "C:/" */
|
|
11
|
-
const DRIVE_LETTER = /^[A-Za-z]:\//;
|
|
12
|
-
/** Resolve path segments to an absolute path. */
|
|
6
|
+
/** Resolve path segments to an absolute, normalized path. */
|
|
13
7
|
export function resolve(...paths) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
continue;
|
|
20
|
-
const path = normSep(rawPath);
|
|
21
|
-
if (path.startsWith("/") || DRIVE_LETTER.test(path)) {
|
|
22
|
-
resolvedPath = path;
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
resolvedPath = `${resolvedPath}/${path}`;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
// Preserve drive letter prefix (e.g. "D:/") if present
|
|
29
|
-
let prefix = "/";
|
|
30
|
-
const driveMatch = resolvedPath.match(DRIVE_LETTER);
|
|
31
|
-
if (driveMatch) {
|
|
32
|
-
prefix = driveMatch[0]; // e.g. "D:/"
|
|
33
|
-
resolvedPath = resolvedPath.slice(prefix.length);
|
|
34
|
-
}
|
|
35
|
-
else if (resolvedPath.startsWith("/")) {
|
|
36
|
-
resolvedPath = resolvedPath.slice(1);
|
|
37
|
-
}
|
|
38
|
-
const parts = resolvedPath.split("/").filter(Boolean);
|
|
39
|
-
const resolved = [];
|
|
40
|
-
for (const part of parts) {
|
|
41
|
-
if (part === "..") {
|
|
42
|
-
resolved.pop();
|
|
43
|
-
continue;
|
|
44
|
-
}
|
|
45
|
-
if (part !== ".")
|
|
46
|
-
resolved.push(part);
|
|
47
|
-
}
|
|
48
|
-
return `${prefix}${resolved.join("/")}`;
|
|
8
|
+
const windows = usesWindowsFlavor(paths);
|
|
9
|
+
const pathApi = getNativePathImplementation(windows);
|
|
10
|
+
return pathApi
|
|
11
|
+
? toPortableSeparators(pathApi.resolve(...paths))
|
|
12
|
+
: portableResolve(paths, windows);
|
|
49
13
|
}
|
|
50
14
|
export function isAbsolute(path) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (path.startsWith("/"))
|
|
55
|
-
return true;
|
|
56
|
-
if (/^[A-Za-z]:[/\\]/.test(path))
|
|
57
|
-
return true;
|
|
58
|
-
return /^\\\\[^\\]+\\[^\\]+/.test(path);
|
|
15
|
+
const windows = usesWindowsFlavor([path]);
|
|
16
|
+
const pathApi = getNativePathImplementation(windows);
|
|
17
|
+
return pathApi?.isAbsolute(path) ?? portableIsAbsolute(path, windows);
|
|
59
18
|
}
|
|
60
19
|
export function relative(from, to) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
// Strip drive prefix for comparison (both will share the same drive after resolve)
|
|
68
|
-
const fromDrive = resolvedFrom.match(DRIVE_LETTER);
|
|
69
|
-
const fromBase = fromDrive ? resolvedFrom.slice(fromDrive[0].length) : resolvedFrom.slice(1);
|
|
70
|
-
const toDrive = resolvedTo.match(DRIVE_LETTER);
|
|
71
|
-
const toBase = toDrive ? resolvedTo.slice(toDrive[0].length) : resolvedTo.slice(1);
|
|
72
|
-
const fromParts = fromBase.split("/").filter(Boolean);
|
|
73
|
-
const toParts = toBase.split("/").filter(Boolean);
|
|
74
|
-
let common = 0;
|
|
75
|
-
const minLen = Math.min(fromParts.length, toParts.length);
|
|
76
|
-
for (let i = 0; i < minLen; i++) {
|
|
77
|
-
if (fromParts[i] !== toParts[i])
|
|
78
|
-
break;
|
|
79
|
-
common++;
|
|
80
|
-
}
|
|
81
|
-
const ups = fromParts.length - common;
|
|
82
|
-
const result = [...new Array(ups).fill(".."), ...toParts.slice(common)];
|
|
83
|
-
return result.join("/") || ".";
|
|
20
|
+
const windows = usesWindowsFlavor([from, to]);
|
|
21
|
+
const pathApi = getNativePathImplementation(windows);
|
|
22
|
+
const result = pathApi
|
|
23
|
+
? toPortableSeparators(pathApi.relative(from, to))
|
|
24
|
+
: portableRelative(from, to, windows);
|
|
25
|
+
return result || ".";
|
|
84
26
|
}
|
|
85
27
|
export function normalize(path) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
//
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
if (driveMatch) {
|
|
96
|
-
prefix = driveMatch[0];
|
|
97
|
-
}
|
|
98
|
-
else if (abs) {
|
|
99
|
-
prefix = "/";
|
|
100
|
-
}
|
|
101
|
-
const pathWithoutPrefix = driveMatch ? p.slice(prefix.length) : abs ? p.slice(1) : p;
|
|
102
|
-
const parts = pathWithoutPrefix.split("/").filter((s) => s && s !== ".");
|
|
103
|
-
const normalized = [];
|
|
104
|
-
for (const part of parts) {
|
|
105
|
-
if (part !== "..") {
|
|
106
|
-
normalized.push(part);
|
|
107
|
-
continue;
|
|
108
|
-
}
|
|
109
|
-
const last = normalized[normalized.length - 1];
|
|
110
|
-
if (normalized.length > 0 && last !== "..") {
|
|
111
|
-
normalized.pop();
|
|
112
|
-
continue;
|
|
113
|
-
}
|
|
114
|
-
if (!abs)
|
|
115
|
-
normalized.push("..");
|
|
116
|
-
}
|
|
117
|
-
const result = normalized.join("/");
|
|
118
|
-
if (abs)
|
|
119
|
-
return result ? `${prefix}${result}` : prefix || "/";
|
|
120
|
-
return result || ".";
|
|
28
|
+
const windows = usesWindowsFlavor([path]);
|
|
29
|
+
const pathApi = getNativePathImplementation(windows);
|
|
30
|
+
const normalized = pathApi
|
|
31
|
+
? toPortableSeparators(pathApi.normalize(path))
|
|
32
|
+
: portableNormalize(path, windows);
|
|
33
|
+
// The established Veryfront facade contract returns canonical paths without
|
|
34
|
+
// a trailing separator, except for filesystem roots. Enforce that
|
|
35
|
+
// postcondition independently of whether the runtime supplies node:path.
|
|
36
|
+
return removeTrailingSeparatorsExceptRoot(normalized, windows);
|
|
121
37
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { NodePathModule } from "./types.js";
|
|
1
|
+
import type { NodePathModule, PathImplementation } from "./types.js";
|
|
2
2
|
export declare const isDeno: boolean;
|
|
3
3
|
declare let nodePath: NodePathModule | null;
|
|
4
4
|
export { nodePath };
|
|
5
5
|
export declare const sep: string;
|
|
6
6
|
export declare const delimiter: string;
|
|
7
7
|
export declare const hasNodePath: boolean;
|
|
8
|
+
export declare function getNativePathImplementation(windows: boolean): PathImplementation | null;
|
|
8
9
|
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/path/runtime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/path/runtime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAKrE,eAAO,MAAM,MAAM,SAAsC,CAAC;AAE1D,QAAA,IAAI,QAAQ,EAAE,cAAc,GAAG,IAAW,CAAC;AAe3C,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpB,eAAO,MAAM,GAAG,QAAuB,CAAC;AACxC,eAAO,MAAM,SAAS,QAA6B,CAAC;AACpD,eAAO,MAAM,WAAW,SAAoB,CAAC;AAE7C,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,OAAO,GACf,kBAAkB,GAAG,IAAI,CAG3B"}
|
|
@@ -18,3 +18,8 @@ export { nodePath };
|
|
|
18
18
|
export const sep = nodePath?.sep ?? "/";
|
|
19
19
|
export const delimiter = nodePath?.delimiter ?? ":";
|
|
20
20
|
export const hasNodePath = nodePath !== null;
|
|
21
|
+
export function getNativePathImplementation(windows) {
|
|
22
|
+
if (!nodePath)
|
|
23
|
+
return null;
|
|
24
|
+
return windows ? nodePath.win32 : nodePath.posix;
|
|
25
|
+
}
|
|
@@ -5,7 +5,7 @@ export interface PathObject {
|
|
|
5
5
|
ext?: string;
|
|
6
6
|
name?: string;
|
|
7
7
|
}
|
|
8
|
-
export interface
|
|
8
|
+
export interface PathImplementation {
|
|
9
9
|
sep: string;
|
|
10
10
|
delimiter: string;
|
|
11
11
|
join(...paths: string[]): string;
|
|
@@ -19,4 +19,8 @@ export interface NodePathModule {
|
|
|
19
19
|
parse(path: string): PathObject;
|
|
20
20
|
format(pathObject: PathObject): string;
|
|
21
21
|
}
|
|
22
|
+
export interface NodePathModule extends PathImplementation {
|
|
23
|
+
posix: PathImplementation;
|
|
24
|
+
win32: PathImplementation;
|
|
25
|
+
}
|
|
22
26
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/path/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/path/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IACjC,OAAO,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IACpC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7C,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3C,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC;IAChC,MAAM,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAAC;CACxC;AAED,MAAM,WAAW,cAAe,SAAQ,kBAAkB;IACxD,KAAK,EAAE,kBAAkB,CAAC;IAC1B,KAAK,EAAE,kBAAkB,CAAC;CAC3B"}
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a file URL to a runtime-native filesystem path.
|
|
3
|
+
*
|
|
4
|
+
* Local and `localhost` URLs are supported on every runtime. A non-local host
|
|
5
|
+
* becomes a UNC path on Windows; other runtimes reject it because no
|
|
6
|
+
* unambiguous local path representation exists.
|
|
7
|
+
*
|
|
8
|
+
* @throws {TypeError} If the URL is not a file URL, contains an encoded path
|
|
9
|
+
* separator, or names a non-local host on a non-Windows runtime.
|
|
10
|
+
*/
|
|
1
11
|
export declare function fromFileUrl(url: string | URL): string;
|
|
2
12
|
export declare function toFileUrl(path: string): URL;
|
|
3
13
|
//# sourceMappingURL=url-conversion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url-conversion.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/path/url-conversion.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"url-conversion.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/path/url-conversion.ts"],"names":[],"mappings":"AA8BA;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,MAAM,CAwBrD;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAmB3C"}
|
|
@@ -1,53 +1,75 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return _fileURLToPath;
|
|
8
|
-
if (!hasNodePath)
|
|
9
|
-
return null;
|
|
10
|
-
try {
|
|
11
|
-
const nodeUrl = dntShim.dntGlobalThis.require?.("node:url");
|
|
12
|
-
const fileURLToPath = nodeUrl?.fileURLToPath;
|
|
13
|
-
if (!fileURLToPath)
|
|
14
|
-
return null;
|
|
15
|
-
_fileURLToPath = fileURLToPath;
|
|
16
|
-
return _fileURLToPath;
|
|
1
|
+
import { posix } from "./posix.js";
|
|
2
|
+
import { resolve } from "./resolution.js";
|
|
3
|
+
import { runtimeUsesWindowsPaths } from "./portable.js";
|
|
4
|
+
function decodeFilePath(pathname, windows) {
|
|
5
|
+
if (/%2f/i.test(pathname) || (windows && /%5c/i.test(pathname))) {
|
|
6
|
+
throw new TypeError("File URL path must not include encoded path separators");
|
|
17
7
|
}
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
return decodeURIComponent(pathname);
|
|
9
|
+
}
|
|
10
|
+
function encodePath(path) {
|
|
11
|
+
// Match filesystem URL encoding: protect characters that URL parsing would
|
|
12
|
+
// interpret structurally while leaving valid path characters such as a
|
|
13
|
+
// drive-like colon untouched when it appears inside a POSIX path segment.
|
|
14
|
+
return path
|
|
15
|
+
.replaceAll("%", "%25")
|
|
16
|
+
.replaceAll("\\", "%5C")
|
|
17
|
+
.replaceAll("#", "%23")
|
|
18
|
+
.replaceAll("?", "%3F");
|
|
19
|
+
}
|
|
20
|
+
function parseUncPath(path) {
|
|
21
|
+
if (!runtimeUsesWindowsPaths() && !path.startsWith("\\\\"))
|
|
20
22
|
return null;
|
|
21
|
-
|
|
23
|
+
const portable = path.replaceAll("\\", "/");
|
|
24
|
+
const match = portable.match(/^\/\/([^/]+)(\/.*)$/);
|
|
25
|
+
if (!match?.[1] || !match[2])
|
|
26
|
+
return null;
|
|
27
|
+
return { host: match[1], pathname: match[2] };
|
|
22
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Convert a file URL to a runtime-native filesystem path.
|
|
31
|
+
*
|
|
32
|
+
* Local and `localhost` URLs are supported on every runtime. A non-local host
|
|
33
|
+
* becomes a UNC path on Windows; other runtimes reject it because no
|
|
34
|
+
* unambiguous local path representation exists.
|
|
35
|
+
*
|
|
36
|
+
* @throws {TypeError} If the URL is not a file URL, contains an encoded path
|
|
37
|
+
* separator, or names a non-local host on a non-Windows runtime.
|
|
38
|
+
*/
|
|
23
39
|
export function fromFileUrl(url) {
|
|
24
40
|
const parsedUrl = typeof url === "string" ? new URL(url) : url;
|
|
25
41
|
if (parsedUrl.protocol !== "file:") {
|
|
26
42
|
throw new TypeError("Must be a file URL");
|
|
27
43
|
}
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const g = dntShim.dntGlobalThis;
|
|
33
|
-
const hasCwd = Boolean(g.Deno?.cwd);
|
|
34
|
-
const isWindows = g.Deno?.build?.os === "windows";
|
|
35
|
-
if (hasCwd && isWindows) {
|
|
36
|
-
return decodeURIComponent(parsedUrl.pathname)
|
|
37
|
-
.replace(/^\/([A-Za-z]:)/, "$1")
|
|
38
|
-
.replace(/\//g, "\\");
|
|
39
|
-
}
|
|
40
|
-
return decodeURIComponent(parsedUrl.pathname);
|
|
44
|
+
const windows = runtimeUsesWindowsPaths();
|
|
45
|
+
const host = parsedUrl.hostname;
|
|
46
|
+
if (host && host !== "localhost" && !windows) {
|
|
47
|
+
throw new TypeError("File URL host must be empty or localhost on non-Windows runtimes");
|
|
41
48
|
}
|
|
42
|
-
|
|
49
|
+
const pathname = decodeFilePath(parsedUrl.pathname, windows);
|
|
50
|
+
if (host && host !== "localhost") {
|
|
51
|
+
return `\\\\${host}${pathname.replaceAll("/", "\\")}`;
|
|
52
|
+
}
|
|
53
|
+
if (!windows)
|
|
54
|
+
return pathname;
|
|
55
|
+
return pathname
|
|
56
|
+
.replace(/^\/([A-Za-z]:)/, "$1")
|
|
57
|
+
.replaceAll("/", "\\");
|
|
43
58
|
}
|
|
44
59
|
export function toFileUrl(path) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
.
|
|
51
|
-
|
|
52
|
-
|
|
60
|
+
if (typeof path !== "string") {
|
|
61
|
+
throw new TypeError(`Path must be a string. Received ${typeof path}`);
|
|
62
|
+
}
|
|
63
|
+
const unc = parseUncPath(path);
|
|
64
|
+
if (unc) {
|
|
65
|
+
return new URL(`file://${unc.host}${encodePath(unc.pathname)}`);
|
|
66
|
+
}
|
|
67
|
+
const portable = path.replaceAll("\\", "/");
|
|
68
|
+
const drive = portable.match(/^([A-Za-z]:)(\/.*)?$/);
|
|
69
|
+
if (drive?.[1]) {
|
|
70
|
+
const pathname = drive[2] ?? "/";
|
|
71
|
+
return new URL(`file:///${drive[1]}${encodePath(pathname)}`);
|
|
72
|
+
}
|
|
73
|
+
const absolute = runtimeUsesWindowsPaths() ? resolve(path) : posix.resolve(path);
|
|
74
|
+
return new URL(`file://${encodePath(absolute)}`);
|
|
53
75
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veryfront/ext-content-mdx",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1185",
|
|
4
4
|
"description": "Veryfront first-party extension package for ext-content-mdx",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"veryfront",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"vfile": "6.0.3"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
|
-
"veryfront": "^0.1.
|
|
70
|
+
"veryfront": "^0.1.1185"
|
|
71
71
|
},
|
|
72
72
|
"type": "module",
|
|
73
73
|
"types": "./esm/extensions/ext-content-mdx/src/index.d.ts",
|