File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,16 @@ const isObject = val => val !== null && typeof val === 'object' && !Array.isArra
66// this is a modified version of https://github.com/chalk/ansi-regex (MIT License)
77const ANSI_REGEX = / [ \u001b \u009b ] [ [ \] # ; ? ( ) ] * (?: (?: (?: [ ^ \W _ ] * ; ? [ ^ \W _ ] * ) \u0007 ) | (?: (?: [ 0 - 9 ] { 1 , 4 } ( ; [ 0 - 9 ] { 0 , 4 } ) * ) ? [ ~ 0 - 9 = < > c f - n q r t y A - P R Z ] ) ) / g;
88
9+ const hasColor = ( ) => {
10+ if ( typeof process !== 'undefined' ) {
11+ return process . env . FORCE_COLOR !== '0' ;
12+ }
13+ return false ;
14+ } ;
15+
916const create = ( ) => {
1017 const colors = {
11- enabled : process . env . FORCE_COLOR !== '0' ,
18+ enabled : hasColor ( ) ,
1219 visible : true ,
1320 styles : { } ,
1421 keys : { }
Original file line number Diff line number Diff line change 11'use strict' ;
22
3- const isHyper = process . env . TERM_PROGRAM === 'Hyper' ;
4- const isWindows = process . platform === 'win32' ;
5- const isLinux = process . platform === 'linux' ;
3+ const isHyper = typeof process !== 'undefined' && process . env . TERM_PROGRAM === 'Hyper' ;
4+ const isWindows = typeof process !== 'undefined' && process . platform === 'win32' ;
5+ const isLinux = typeof process !== 'undefined' && process . platform === 'linux' ;
66
77const common = {
88 ballotDisabled : '☒' ,
You can’t perform that action at this time.
0 commit comments