File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ 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 = typeof process !== 'undefined' ? process ? .env ?. COLORS : undefined
11
11
if ( colors ) {
12
12
const b = JSON . parse ( colors )
13
13
if ( typeof b === 'boolean' ) return b
@@ -18,7 +18,7 @@ const shouldHighlight = () => {
18
18
19
19
// In all other cases, whether COLORS was a weird type, or the attempt threw:
20
20
// Fall back to colorizing if we are running in node.
21
- return ! ! process ? .versions ?. node
21
+ return typeof process !== 'undefined' && ! ! process . versions ?. node
22
22
}
23
23
24
24
const { DOMCollection} = prettyFormat . plugins
You can’t perform that action at this time.
0 commit comments