Skip to content

Commit 306526b

Browse files
authored
fix: safer read of DEBUG_PRINT_LIMIT (#1329)
1 parent fdc12ec commit 306526b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/pretty-dom.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ function prettyDOM(dom, maxLength, options = {}) {
4747
}
4848
if (typeof maxLength !== 'number') {
4949
maxLength =
50-
(typeof process !== 'undefined' && process.env.DEBUG_PRINT_LIMIT) || 7000
50+
(typeof process !== 'undefined' &&
51+
typeof process.env !== 'undefined' &&
52+
process.env.DEBUG_PRINT_LIMIT) ||
53+
7000
5154
}
5255

5356
if (maxLength === 0) {

0 commit comments

Comments
 (0)