From 818a8010928cb8cef0b7043bd881c8cdce9b6efc Mon Sep 17 00:00:00 2001 From: River <22485304+actual-size@users.noreply.github.com> Date: Fri, 12 Jun 2020 02:36:20 +1000 Subject: feat: URL support in Deno filesystem methods (#5990) --- cli/js/files.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cli/js/files.ts') diff --git a/cli/js/files.ts b/cli/js/files.ts index d6df8bad0..83922627a 100644 --- a/cli/js/files.ts +++ b/cli/js/files.ts @@ -21,7 +21,7 @@ import { export { OpenOptions } from "./ops/fs/open.ts"; export function openSync( - path: string, + path: string | URL, options: OpenOptions = { read: true } ): File { checkOpenOptions(options); @@ -30,7 +30,7 @@ export function openSync( } export async function open( - path: string, + path: string | URL, options: OpenOptions = { read: true } ): Promise { checkOpenOptions(options); @@ -38,7 +38,7 @@ export async function open( return new File(rid); } -export function createSync(path: string): File { +export function createSync(path: string | URL): File { return openSync(path, { read: true, write: true, @@ -47,7 +47,7 @@ export function createSync(path: string): File { }); } -export function create(path: string): Promise { +export function create(path: string | URL): Promise { return open(path, { read: true, write: true, -- cgit v1.2.3