Decode file path URI scheme
MODIFY
packages/@romejs/path/index.ts
packages/@romejs/path/index.ts
@@ -648,7 +648,10 @@ function parsePathSegments(segments: PathSegments): ParsedPath {
switch (absoluteTarget) {
case 'file':
- return parsePathSegments(segments.slice(2));
+ // Automatically normalize a file scheme into an absolute path
+ return parsePathSegments(segments.slice(2).map((segment) =>
+ decodeURIComponent(segment)
+ ));
default:
const absoluteSegments = segments.slice(0, 3);

Decode file path URI scheme