()
| 5 | let cachedUseCliColor: boolean | undefined; |
| 6 | |
| 7 | function shouldUseCliColor(): boolean { |
| 8 | if (cachedUseCliColor === undefined) { |
| 9 | cachedUseCliColor = process.stdout.isTTY === true && process.env.NO_COLOR === undefined; |
| 10 | } |
| 11 | return cachedUseCliColor; |
| 12 | } |
| 13 | |
| 14 | function colorRed(text: string): string { |
| 15 | return `${ANSI_RED}${text}${ANSI_RESET}`; |