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/fmt/colors.ts | 4 ++-- std/fmt/colors_test.ts | 6 +++--- std/fmt/mod.ts | 2 ++ 3 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 std/fmt/mod.ts (limited to 'std/fmt') diff --git a/std/fmt/colors.ts b/std/fmt/colors.ts index 52ba22487..3f241d5b0 100644 --- a/std/fmt/colors.ts +++ b/std/fmt/colors.ts @@ -21,7 +21,7 @@ interface Code { let enabled = !noColor; -export function setEnabled(value: boolean): void { +export function setColorEnabled(value: boolean): void { if (noColor) { return; } @@ -29,7 +29,7 @@ export function setEnabled(value: boolean): void { enabled = value; } -export function getEnabled(): boolean { +export function getColorEnabled(): boolean { return enabled; } diff --git a/std/fmt/colors_test.ts b/std/fmt/colors_test.ts index 949bc34e7..467cda1bb 100644 --- a/std/fmt/colors_test.ts +++ b/std/fmt/colors_test.ts @@ -17,10 +17,10 @@ test(function replacesCloseCharacters(): void { }); test(function enablingColors(): void { - assertEquals(c.getEnabled(), true); - c.setEnabled(false); + assertEquals(c.getColorEnabled(), true); + c.setColorEnabled(false); assertEquals(c.bgBlue(c.red("foo bar")), "foo bar"); - c.setEnabled(true); + c.setColorEnabled(true); assertEquals(c.red("foo bar"), "foo bar"); }); diff --git a/std/fmt/mod.ts b/std/fmt/mod.ts new file mode 100644 index 000000000..a0f8feb8b --- /dev/null +++ b/std/fmt/mod.ts @@ -0,0 +1,2 @@ +export * from "./colors.ts"; +export * from "./sprintf.ts"; -- cgit v1.2.3