mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 10:33:54 +00:00
feat: URL support in Deno filesystem methods (#5990)
This commit is contained in:
parent
813210d433
commit
818a801092
28 changed files with 741 additions and 66 deletions
|
@ -1,6 +1,7 @@
|
|||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||
|
||||
import { assert, assertEquals } from "../../../std/testing/asserts.ts";
|
||||
import { resolve } from "../../../std/path/mod.ts";
|
||||
export {
|
||||
assert,
|
||||
assertThrows,
|
||||
|
@ -363,3 +364,9 @@ unitTest(
|
|||
});
|
||||
}
|
||||
);
|
||||
|
||||
export function pathToAbsoluteFileUrl(path: string): URL {
|
||||
path = resolve(path);
|
||||
|
||||
return new URL(`file://${Deno.build.os === "windows" ? "/" : ""}${path}`);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue