summaryrefslogtreecommitdiff
path: root/cli/js/read_file.ts
diff options
context:
space:
mode:
authorRiver <22485304+actual-size@users.noreply.github.com>2020-06-12 02:36:20 +1000
committerGitHub <noreply@github.com>2020-06-11 12:36:20 -0400
commit818a8010928cb8cef0b7043bd881c8cdce9b6efc (patch)
tree1502e74c9eb01901df8da118257d60d4f962b0e4 /cli/js/read_file.ts
parent813210d4337bf6e174f1da1f1a6c6fb9b073afa2 (diff)
feat: URL support in Deno filesystem methods (#5990)
Diffstat (limited to 'cli/js/read_file.ts')
-rw-r--r--cli/js/read_file.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/js/read_file.ts b/cli/js/read_file.ts
index 317401af5..b8d428b8c 100644
--- a/cli/js/read_file.ts
+++ b/cli/js/read_file.ts
@@ -2,14 +2,14 @@
import { open, openSync } from "./files.ts";
import { readAll, readAllSync } from "./buffer.ts";
-export function readFileSync(path: string): Uint8Array {
+export function readFileSync(path: string | URL): Uint8Array {
const file = openSync(path);
const contents = readAllSync(file);
file.close();
return contents;
}
-export async function readFile(path: string): Promise<Uint8Array> {
+export async function readFile(path: string | URL): Promise<Uint8Array> {
const file = await open(path);
const contents = await readAll(file);
file.close();