Total Complexity | 1 |
Complexity/F | 1 |
Lines of Code | 55 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | const codes = { |
||
2 | reset : [0, 0], |
||
3 | |||
4 | bold : [1, 22], |
||
5 | dim : [2, 22], |
||
6 | italic : [3, 23], |
||
7 | underline : [4, 24], |
||
8 | inverse : [7, 27], |
||
9 | hidden : [8, 28], |
||
10 | strikethrough : [9, 29], |
||
11 | |||
12 | black : [30, 39], |
||
13 | red : [31, 39], |
||
14 | green : [32, 39], |
||
15 | yellow : [33, 39], |
||
16 | blue : [34, 39], |
||
17 | magenta : [35, 39], |
||
18 | cyan : [36, 39], |
||
19 | white : [37, 39], |
||
20 | gray : [90, 39], |
||
21 | grey : [90, 39], |
||
22 | |||
23 | bgBlack : [40, 49], |
||
24 | bgRed : [41, 49], |
||
25 | bgGreen : [42, 49], |
||
26 | bgYellow : [43, 49], |
||
27 | bgBlue : [44, 49], |
||
28 | bgMagenta : [45, 49], |
||
29 | bgCyan : [46, 49], |
||
30 | bgWhite : [47, 49], |
||
31 | |||
32 | // legacy styles for colors pre v1.0.0 |
||
33 | blackBG : [40, 49], |
||
34 | redBG : [41, 49], |
||
35 | greenBG : [42, 49], |
||
36 | yellowBG : [43, 49], |
||
37 | blueBG : [44, 49], |
||
38 | magentaBG : [45, 49], |
||
39 | cyanBG : [46, 49], |
||
40 | whiteBG : [47, 49] |
||
41 | }, |
||
42 | styles = { |
||
43 | }; |
||
44 | |||
45 | Object.keys(codes).forEach((key) => { |
||
46 | const val = codes[key], |
||
47 | style = { |
||
48 | open : `\u001b[${val[0]}m`, |
||
49 | close : `\u001b[${val[1]}m` |
||
50 | }; |
||
51 | |||
52 | styles[key] = style; |
||
53 | }); |
||
54 | |||
55 | module.exports = styles; |
||
56 |