From 4ebd24342368adbb99582b87dc6c4b8cb6f44c87 Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Mon, 25 May 2020 18:32:34 +0100 Subject: fix(std/testing/asserts): Support browsers (#5847) --- std/fmt/colors.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'std/fmt') 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; -- cgit v1.2.3