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'
77const shouldHighlight = ( ) => {
88 // Try to safely parse env COLORS: We will default behavior if any step fails.
99 try {
10- const colors = process ? .env ?. COLORS
10+ const colors = typeof process !== 'undefined' ? process ? .env ?. COLORS : undefined
1111 if ( colors ) {
1212 const b = JSON . parse ( colors )
1313 if ( typeof b === 'boolean' ) return b
@@ -18,7 +18,7 @@ const shouldHighlight = () => {
1818
1919 // In all other cases, whether COLORS was a weird type, or the attempt threw:
2020 // Fall back to colorizing if we are running in node.
21- return ! ! process ? .versions ?. node
21+ return typeof process !== 'undefined' && ! ! process . versions ?. node
2222}
2323
2424const { DOMCollection} = prettyFormat . plugins
You can’t perform that action at this time.
0 commit comments