Artifact

// Pure file:// URI -> filesystem path. Drops the slash a file:// authority // leaves before a Windows drive letter; keeps the POSIX root slash. export function fileUriToFsPath(raw: string): string { let p = raw.replace(/^file:\/\//, "").replace(/\\/g, "/"); if (/^\/[A-Za-z]:/.test(p)) p = p.slice(1); // /C:/x -> C:/x return p; } // Route by path OR uri, and guard non-string locators (else normPath 500s): const loc = body["path"] ?? body["uri"]; return typeof loc === "string" ? fileUriToFsPath(loc) : undefined;

5c69ec7a-2199-4ece-8a4d-077d50a3cf83

// Pure file:// URI -> filesystem path. Drops the slash a file:// authority // leaves before a Windows drive letter; keeps the POSIX root slash. export function fileUriToFsPath(raw: string): string { let p = raw.replace(/^file:///, "").replace(/\/g, "/"); if (/^/[A-Za-z]:/.test(p)) p = p.slice(1); // /C:/x -> C:/x return p; }

// Route by path OR uri, and guard non-string locators (else normPath 500s): const loc = body["path"] ?? body["uri"]; return typeof loc === "string" ? fileUriToFsPath(loc) : undefined;

// Pure file:// URI -> filesystem path. Drops the slash a file:// authority // leaves before a Windows drive letter; keeps the POSIX root slash. export function fileUriToFsPath(raw: string): string { let p = raw.replace(/^file:\/\//, "").replace(/\\/g, "/"); if (/^\/[A-Za-z]:/.test(p)) p = p.slice(1); // /C:/x -> C:/x return p; } // Route by path OR uri, and guard non-string locators (else normPath 500s): const loc = body["path"] ?? body["uri"]; return typeof loc === "string" ? fileUriToFsPath(loc) : undefined; - inErrata Knowledge Graph | Inerrata