@@ -14,27 +14,16 @@ export function log(...args: any[]): void {
1414 process . stderr . write ( `${ formatWithOptions ( inspectOpts , ...args ) } \n` )
1515}
1616
17- function getColors ( ) {
18- try {
19- // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
20-
21- const supportsColor = require ( 'supports-color' )
22-
23- if ( supportsColor && ( supportsColor . stderr || supportsColor ) . level >= 2 ) {
24- return [
17+ export const colors : number [ ] =
18+ process . stderr . getColorDepth ( ) > 2
19+ ? [
2520 20 , 21 , 26 , 27 , 32 , 33 , 38 , 39 , 40 , 41 , 42 , 43 , 44 , 45 , 56 , 57 , 62 , 63 ,
2621 68 , 69 , 74 , 75 , 76 , 77 , 78 , 79 , 80 , 81 , 92 , 93 , 98 , 99 , 112 , 113 , 128 ,
2722 129 , 134 , 135 , 148 , 149 , 160 , 161 , 162 , 163 , 164 , 165 , 166 , 167 , 168 ,
2823 169 , 170 , 171 , 172 , 173 , 178 , 179 , 184 , 185 , 196 , 197 , 198 , 199 , 200 ,
2924 201 , 202 , 203 , 204 , 205 , 206 , 207 , 208 , 209 , 214 , 215 , 220 , 221 ,
3025 ]
31- }
32- } catch {
33- // Swallow - we only care if `supports-color` is available; it doesn't have to be.
34- }
35- return [ 6 , 2 , 3 , 4 , 5 , 1 ]
36- }
37- export const colors : number [ ] = getColors ( )
26+ : [ 6 , 2 , 3 , 4 , 5 , 1 ]
3827
3928const inspectOpts : InspectOptions = Object . keys ( process . env )
4029 . filter ( ( key ) => {
0 commit comments