diff options
Diffstat (limited to 'cli/rt/01_colors.js')
-rw-r--r-- | cli/rt/01_colors.js | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/cli/rt/01_colors.js b/cli/rt/01_colors.js index 39e4a7a18..2dc559186 100644 --- a/cli/rt/01_colors.js +++ b/cli/rt/01_colors.js @@ -10,7 +10,9 @@ } function run(str, code) { - return `${code.open}${str.replace(code.regexp, code.open)}${code.close}`; + return !globalThis || !globalThis.Deno || globalThis.Deno.noColor + ? str + : `${code.open}${str.replace(code.regexp, code.open)}${code.close}`; } function bold(str) { @@ -70,10 +72,6 @@ return string.replace(ANSI_PATTERN, ""); } - function maybeColor(fn) { - return !(globalThis.Deno?.noColor ?? false) ? fn : (s) => s; - } - window.__bootstrap.colors = { bold, italic, @@ -87,6 +85,5 @@ magenta, dim, stripColor, - maybeColor, }; })(this); |