feat: URL support in Deno filesystem methods (#5990)

This commit is contained in:
River 2020-06-12 02:36:20 +10:00 committed by GitHub
parent 813210d433
commit 818a801092
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 741 additions and 66 deletions

View file

@ -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<File> {
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<File> {
export function create(path: string | URL): Promise<File> {
return open(path, {
read: true,
write: true,