summaryrefslogtreecommitdiff
path: root/cli/js/read_text_file.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/read_text_file.ts')
-rw-r--r--cli/js/read_text_file.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/js/read_text_file.ts b/cli/js/read_text_file.ts
index 3423b26b8..154b01b0e 100644
--- a/cli/js/read_text_file.ts
+++ b/cli/js/read_text_file.ts
@@ -1,7 +1,7 @@
import { open, openSync } from "./files.ts";
import { readAll, readAllSync } from "./buffer.ts";
-export function readTextFileSync(path: string): string {
+export function readTextFileSync(path: string | URL): string {
const decoder = new TextDecoder();
const file = openSync(path);
const content = readAllSync(file);
@@ -9,7 +9,7 @@ export function readTextFileSync(path: string): string {
return decoder.decode(content);
}
-export async function readTextFile(path: string): Promise<string> {
+export async function readTextFile(path: string | URL): Promise<string> {
const decoder = new TextDecoder();
const file = await open(path);
const content = await readAll(file);