From 0171d619ec151e48cd29d65779967bfcef78c617 Mon Sep 17 00:00:00 2001 From: Siem Lasseel Date: Mon, 15 Jul 2024 16:09:28 +0200 Subject: [PATCH] fix: safer read of DEBUG_PRINT_LIMIT --- src/pretty-dom.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pretty-dom.js b/src/pretty-dom.js index 9b1eafa2..dcff080a 100644 --- a/src/pretty-dom.js +++ b/src/pretty-dom.js @@ -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) {