summaryrefslogtreecommitdiff
path: root/std/fmt
diff options
context:
space:
mode:
authorNayeem Rahman <muhammed.9939@gmail.com>2019-12-20 20:21:30 +0000
committerRy Dahl <ry@tinyclouds.org>2019-12-20 15:21:30 -0500
commite8d82a6348d4cf9fc6a023fe16bf75df7fea61b0 (patch)
tree6d9e44694bf55a7e3089b1706dc05919ccc0dc27 /std/fmt
parent29562ed61ea42e46c86cef919f27033f6b3427b0 (diff)
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.
Diffstat (limited to 'std/fmt')
-rw-r--r--std/fmt/colors.ts4
-rw-r--r--std/fmt/colors_test.ts6
-rw-r--r--std/fmt/mod.ts2
3 files changed, 7 insertions, 5 deletions
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";