(stream: { isTTY?: boolean } = process.stdout)
| 594 | } |
| 595 | |
| 596 | export function supportsColor(stream: { isTTY?: boolean } = process.stdout): boolean { |
| 597 | const forceColor = process.env.FORCE_COLOR; |
| 598 | if (typeof forceColor === 'string') { |
| 599 | return forceColor !== '0'; |
| 600 | } |
| 601 | if (typeof process.env.NO_COLOR === 'string') { |
| 602 | return false; |
| 603 | } |
| 604 | return Boolean(stream.isTTY); |
| 605 | } |
| 606 | |
| 607 | export function colorize( |
| 608 | text: string, |
no outgoing calls
no test coverage detected