-
Notifications
You must be signed in to change notification settings - Fork 467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Reduce caught exceptions in prettyDom (reland) #1323
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 964d6e8:
|
src/pretty-dom.js
Outdated
@@ -7,7 +7,7 @@ import {getConfig} from './config' | |||
const shouldHighlight = () => { | |||
// Try to safely parse env COLORS: We will default behavior if any step fails. | |||
try { | |||
const colors = process?.env?.COLORS | |||
const colors = typeof process !== 'undefined' ? process?.env?.COLORS : undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One less caught exception
process
only if defined05c66d9
to
3db439b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Yes I believe you captured the intend of my PR well. Thanks!
Stacked on #1324
Relands #1321 which originally caused #1322
@DavidRieman Could you give this a look if
3db439b
(#1323) is still matching your original intention?