()
| 76 | * @see https://force-color.org/ |
| 77 | */ |
| 78 | export function shouldDisableColor(): boolean { |
| 79 | // FORCE_COLOR takes precedence |
| 80 | if (process.env.FORCE_COLOR !== undefined) { |
| 81 | return process.env.FORCE_COLOR === '0' |
| 82 | } |
| 83 | |
| 84 | // NO_COLOR standard: presence (any value) disables color |
| 85 | if (process.env.NO_COLOR !== undefined) { |
| 86 | return true |
| 87 | } |
| 88 | |
| 89 | // Check if output is a TTY |
| 90 | if (!process.stdout.isTTY) { |
| 91 | return true |
| 92 | } |
| 93 | |
| 94 | return false |
| 95 | } |
| 96 | |
| 97 | /** |
| 98 | * Get a chalk instance configured for current output settings. |
no outgoing calls
no test coverage detected