diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2020-05-25 18:32:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-25 13:32:34 -0400 |
commit | 4ebd24342368adbb99582b87dc6c4b8cb6f44c87 (patch) | |
tree | 0e98b22c00497d48ea901bc24bad8fe182fdd056 /std/fmt | |
parent | 08f74e1f6a180e83e13f5570811b8b7fcec90e9f (diff) |
fix(std/testing/asserts): Support browsers (#5847)
Diffstat (limited to 'std/fmt')
-rw-r--r-- | std/fmt/colors.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/std/fmt/colors.ts b/std/fmt/colors.ts index 6a06af20e..a020657d9 100644 --- a/std/fmt/colors.ts +++ b/std/fmt/colors.ts @@ -1,6 +1,5 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -/** - * A module to print ANSI terminal colors. Inspired by chalk, kleur, and colors +/** A module to print ANSI terminal colors. Inspired by chalk, kleur, and colors * on npm. * * ``` @@ -10,8 +9,10 @@ * * This module supports `NO_COLOR` environmental variable disabling any coloring * if `NO_COLOR` is set. - */ -const { noColor } = Deno; + * + * This module is browser compatible. */ + +const noColor = globalThis.Deno?.noColor ?? true; interface Code { open: string; |