From e8d82a6348d4cf9fc6a023fe16bf75df7fea61b0 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Fri, 20 Dec 2019 20:21:30 +0000 Subject: feat: Add missing mod.ts files in std (#3509) std/archive/tar.ts: - Remove FileReader. - Remove FileWriter. std/encoding/csv.ts: - ExtendedParseOptions -> ParseOptions - HeaderOption -> HeaderOptions - ParseOptions -> ReadOptions - readAll() -> readMatrix() std/encoding/yaml.ts: - DumpOptions -> StringifyOptions std/fmt/colors.ts: - getEnabled() -> getColorEnabled() - setEnabled() -> setColorEnabled() std/testing/mod.ts: - Re-export sibling modules. --- std/archive/mod.ts | 1 + std/archive/tar.ts | 24 +----------------------- 2 files changed, 2 insertions(+), 23 deletions(-) create mode 100644 std/archive/mod.ts (limited to 'std/archive') diff --git a/std/archive/mod.ts b/std/archive/mod.ts new file mode 100644 index 000000000..254b8266f --- /dev/null +++ b/std/archive/mod.ts @@ -0,0 +1 @@ +export * from "./tar.ts"; diff --git a/std/archive/tar.ts b/std/archive/tar.ts index 8ebfa7fb5..e53cd9111 100644 --- a/std/archive/tar.ts +++ b/std/archive/tar.ts @@ -35,7 +35,7 @@ const ustar = "ustar\u000000"; /** * Simple file reader */ -export class FileReader implements Deno.Reader { +class FileReader implements Deno.Reader { private file?: Deno.File; constructor(private filePath: string, private mode: Deno.OpenMode = "r") {} @@ -53,28 +53,6 @@ export class FileReader implements Deno.Reader { } } -/** - * Simple file writer (call FileWriter.dispose() after use) - */ -export class FileWriter implements Deno.Writer { - private file?: Deno.File; - - constructor(private filePath: string, private mode: Deno.OpenMode = "w") {} - - public async write(p: Uint8Array): Promise { - if (!this.file) { - this.file = await Deno.open(this.filePath, this.mode); - } - return Deno.write(this.file.rid, p); - } - - public dispose(): void { - if (!this.file) return; - Deno.close(this.file.rid); - this.file = undefined; - } -} - /** * Remove the trailing null codes * @param buffer -- cgit v1.2.3