From 4a8d25646aa58e3e59d622e69c41822b40415c46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sat, 25 Apr 2020 00:45:55 +0200 Subject: BREAKING CHANGE: remove Deno.OpenMode (#4884) This commit removes Deno.OpenMode along with overloaded variants of Deno.open() and Deno.openSync() that used OpenMode. --- std/archive/tar.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'std/archive') diff --git a/std/archive/tar.ts b/std/archive/tar.ts index 6bc2b92d0..699b982a9 100644 --- a/std/archive/tar.ts +++ b/std/archive/tar.ts @@ -39,15 +39,15 @@ const ustar = "ustar\u000000"; class FileReader implements Deno.Reader { private file?: Deno.File; - constructor(private filePath: string, private mode: Deno.OpenMode = "r") {} + constructor(private filePath: string) {} public async read(p: Uint8Array): Promise { if (!this.file) { - this.file = await Deno.open(this.filePath, this.mode); + this.file = await Deno.open(this.filePath, { read: true }); } const res = await Deno.read(this.file.rid, p); if (res === Deno.EOF) { - await Deno.close(this.file.rid); + Deno.close(this.file.rid); this.file = undefined; } return res; -- cgit v1.2.3