From 5eccdb077564e83b28a2af5641a00a5b266d6069 Mon Sep 17 00:00:00 2001 From: vlazh Date: Tue, 26 Oct 2021 11:05:23 +0600 Subject: [PATCH] Wrap NODE_ENV conditional code in block --- src/helpers/classList.js | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/helpers/classList.js b/src/helpers/classList.js index c4da5b0e..f2ce09d2 100644 --- a/src/helpers/classList.js +++ b/src/helpers/classList.js @@ -25,30 +25,30 @@ export function resetState() { /* istanbul ignore next */ export function log() { - if (process.env.NODE_ENV === "production") return; + if (process.env.NODE_ENV !== "production") { + let classes = document.getElementsByTagName("html")[0].className; + let buffer = "Show tracked classes:\n\n"; - let classes = document.getElementsByTagName("html")[0].className; - let buffer = "Show tracked classes:\n\n"; + buffer += ` (${classes}): + `; + for (let x in htmlClassList) { + buffer += ` ${x} ${htmlClassList[x]} + `; + } - buffer += ` (${classes}): -`; - for (let x in htmlClassList) { - buffer += ` ${x} ${htmlClassList[x]} -`; - } - - classes = document.body.className; + classes = document.body.className; - buffer += `\n\ndoc.body (${classes}): -`; - for (let x in docBodyClassList) { - buffer += ` ${x} ${docBodyClassList[x]} -`; - } + buffer += `\n\ndoc.body (${classes}): + `; + for (let x in docBodyClassList) { + buffer += ` ${x} ${docBodyClassList[x]} + `; + } - buffer += "\n"; + buffer += "\n"; - console.log(buffer); + console.log(buffer); + } } /* eslint-enable no-console */