Skip to content

Commit

Permalink
fix: safer read of DEBUG_PRINT_LIMIT (#1329)
Browse files Browse the repository at this point in the history
  • Loading branch information
sieem committed Jul 15, 2024
1 parent fdc12ec commit 306526b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pretty-dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ function prettyDOM(dom, maxLength, options = {}) {
}
if (typeof maxLength !== 'number') {
maxLength =
(typeof process !== 'undefined' && process.env.DEBUG_PRINT_LIMIT) || 7000
(typeof process !== 'undefined' &&
typeof process.env !== 'undefined' &&
process.env.DEBUG_PRINT_LIMIT) ||
7000
}

if (maxLength === 0) {
Expand Down

0 comments on commit 306526b

Please sign in to comment.