|
8 | 8 | import * as caps from './caps';
|
9 | 9 | import { colors } from './colors';
|
10 | 10 |
|
11 |
| -export const reset = caps.stdout.colors ? colors.reset : (x: string) => x; |
12 |
| -export const bold = caps.stdout.colors ? colors.bold : (x: string) => x; |
13 |
| -export const dim = caps.stdout.colors ? colors.dim : (x: string) => x; |
14 |
| -export const italic = caps.stdout.colors ? colors.italic : (x: string) => x; |
15 |
| -export const underline = caps.stdout.colors ? colors.underline : (x: string) => x; |
16 |
| -export const inverse = caps.stdout.colors ? colors.inverse : (x: string) => x; |
17 |
| -export const hidden = caps.stdout.colors ? colors.hidden : (x: string) => x; |
18 |
| -export const strikethrough = caps.stdout.colors ? colors.strikethrough : (x: string) => x; |
| 11 | +const stdout = typeof process == 'object' |
| 12 | + ? caps.getCapabilities(process.stdout) : { colors: false }; |
19 | 13 |
|
20 |
| -export const black = caps.stdout.colors ? colors.black : (x: string) => x; |
21 |
| -export const red = caps.stdout.colors ? colors.red : (x: string) => x; |
22 |
| -export const green = caps.stdout.colors ? colors.green : (x: string) => x; |
23 |
| -export const yellow = caps.stdout.colors ? colors.yellow : (x: string) => x; |
24 |
| -export const blue = caps.stdout.colors ? colors.blue : (x: string) => x; |
25 |
| -export const magenta = caps.stdout.colors ? colors.magenta : (x: string) => x; |
26 |
| -export const cyan = caps.stdout.colors ? colors.cyan : (x: string) => x; |
27 |
| -export const white = caps.stdout.colors ? colors.white : (x: string) => x; |
28 |
| -export const grey = caps.stdout.colors ? colors.gray : (x: string) => x; |
29 |
| -export const gray = caps.stdout.colors ? colors.gray : (x: string) => x; |
| 14 | +export const reset = stdout.colors ? colors.reset : (x: string) => x; |
| 15 | +export const bold = stdout.colors ? colors.bold : (x: string) => x; |
| 16 | +export const dim = stdout.colors ? colors.dim : (x: string) => x; |
| 17 | +export const italic = stdout.colors ? colors.italic : (x: string) => x; |
| 18 | +export const underline = stdout.colors ? colors.underline : (x: string) => x; |
| 19 | +export const inverse = stdout.colors ? colors.inverse : (x: string) => x; |
| 20 | +export const hidden = stdout.colors ? colors.hidden : (x: string) => x; |
| 21 | +export const strikethrough = stdout.colors ? colors.strikethrough : (x: string) => x; |
30 | 22 |
|
31 |
| -export const bgBlack = caps.stdout.colors ? colors.bgBlack : (x: string) => x; |
32 |
| -export const bgRed = caps.stdout.colors ? colors.bgRed : (x: string) => x; |
33 |
| -export const bgGreen = caps.stdout.colors ? colors.bgGreen : (x: string) => x; |
34 |
| -export const bgYellow = caps.stdout.colors ? colors.bgYellow : (x: string) => x; |
35 |
| -export const bgBlue = caps.stdout.colors ? colors.bgBlue : (x: string) => x; |
36 |
| -export const bgMagenta = caps.stdout.colors ? colors.bgMagenta : (x: string) => x; |
37 |
| -export const bgCyan = caps.stdout.colors ? colors.bgCyan : (x: string) => x; |
38 |
| -export const bgWhite = caps.stdout.colors ? colors.bgWhite : (x: string) => x; |
| 23 | +export const black = stdout.colors ? colors.black : (x: string) => x; |
| 24 | +export const red = stdout.colors ? colors.red : (x: string) => x; |
| 25 | +export const green = stdout.colors ? colors.green : (x: string) => x; |
| 26 | +export const yellow = stdout.colors ? colors.yellow : (x: string) => x; |
| 27 | +export const blue = stdout.colors ? colors.blue : (x: string) => x; |
| 28 | +export const magenta = stdout.colors ? colors.magenta : (x: string) => x; |
| 29 | +export const cyan = stdout.colors ? colors.cyan : (x: string) => x; |
| 30 | +export const white = stdout.colors ? colors.white : (x: string) => x; |
| 31 | +export const grey = stdout.colors ? colors.gray : (x: string) => x; |
| 32 | +export const gray = stdout.colors ? colors.gray : (x: string) => x; |
| 33 | + |
| 34 | +export const bgBlack = stdout.colors ? colors.bgBlack : (x: string) => x; |
| 35 | +export const bgRed = stdout.colors ? colors.bgRed : (x: string) => x; |
| 36 | +export const bgGreen = stdout.colors ? colors.bgGreen : (x: string) => x; |
| 37 | +export const bgYellow = stdout.colors ? colors.bgYellow : (x: string) => x; |
| 38 | +export const bgBlue = stdout.colors ? colors.bgBlue : (x: string) => x; |
| 39 | +export const bgMagenta = stdout.colors ? colors.bgMagenta : (x: string) => x; |
| 40 | +export const bgCyan = stdout.colors ? colors.bgCyan : (x: string) => x; |
| 41 | +export const bgWhite = stdout.colors ? colors.bgWhite : (x: string) => x; |
0 commit comments