UNPKG

@lonu/stc

Version:

A tool for converting OpenApi/Swagger/Apifox into code.

22 lines 719 B
/** * Converts a file URL to a path string. * * @example Usage * ```ts * import { fromFileUrl } from "@std/path/from-file-url"; * import { assertEquals } from "@std/assert"; * * if (Deno.build.os === "windows") { * assertEquals(fromFileUrl("file:///home/foo"), "\\home\\foo"); * assertEquals(fromFileUrl("file:///C:/Users/foo"), "C:\\Users\\foo"); * assertEquals(fromFileUrl("file://localhost/home/foo"), "\\home\\foo"); * } else { * assertEquals(fromFileUrl("file:///home/foo"), "/home/foo"); * } * ``` * * @param url The file URL to convert to a path. * @returns The path string. */ export declare function fromFileUrl(url: string | URL): string; //# sourceMappingURL=from_file_url.d.ts.map