@oazmi/build-tools
Version:
general deno build tool scripts which I practically use in all of my typescript repos
22 lines • 733 B
TypeScript
/**
* Converts a file URL to a path string.
*
* @example Usage
* ```ts
* import { fromFileUrl } from "@std/path/from-file-url";
* import { assertEquals } from "@std/assert/assert-equals";
*
* 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