File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,8 @@ import {getConfig} from './config'
7
7
const shouldHighlight = ( ) => {
8
8
// Try to safely parse env COLORS: We will default behavior if any step fails.
9
9
try {
10
- const colors = process ?. env ?. COLORS
10
+ const colors =
11
+ typeof process !== 'undefined' ? process ?. env ?. COLORS : undefined
11
12
if ( colors ) {
12
13
const b = JSON . parse ( colors )
13
14
if ( typeof b === 'boolean' ) return b
@@ -18,7 +19,7 @@ const shouldHighlight = () => {
18
19
19
20
// In all other cases, whether COLORS was a weird type, or the attempt threw:
20
21
// Fall back to colorizing if we are running in node.
21
- return ! ! process ? .versions ?. node
22
+ return typeof process !== 'undefined' && ! ! process . versions ?. node
22
23
}
23
24
24
25
const { DOMCollection} = prettyFormat . plugins
You can’t perform that action at this time.
0 commit comments