We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f41a86b commit be7811dCopy full SHA for be7811d
logging-utils/src/colours.ts
@@ -49,6 +49,7 @@ export class Colours {
49
*/
50
static isEnabled(stream: tty.WriteStream): boolean {
51
return (
52
+ stream && // May happen in browsers.
53
stream.isTTY &&
54
(typeof stream.getColorDepth === 'function'
55
? stream.getColorDepth() > 2
@@ -57,7 +58,7 @@ export class Colours {
57
58
}
59
60
static refresh(): void {
- Colours.enabled = Colours.isEnabled(process.stderr);
61
+ Colours.enabled = Colours.isEnabled(process?.stderr);
62
if (!this.enabled) {
63
Colours.reset = '';
64
Colours.bright = '';
0 commit comments