From b2e1c664e715ed89395b612cf79c4394b5734b18 Mon Sep 17 00:00:00 2001 From: Pagan Gazzard Date: Mon, 12 Dec 2022 16:42:29 +0000 Subject: [PATCH] Remove support for `DEBUG` env var in favor of only `PINEJS_DEBUG` Change-type: major --- build/browser.ts | 1 - src/config-loader/env.ts | 7 ++----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/build/browser.ts b/build/browser.ts index ca4112a7f..ca7669874 100644 --- a/build/browser.ts +++ b/build/browser.ts @@ -18,7 +18,6 @@ config.plugins = config.plugins.concat( new webpack.DefinePlugin({ 'process.browser': true, 'process.env.CONFIG_LOADER_DISABLED': true, - 'process.env.DEBUG': true, 'process.env.PINEJS_DEBUG': true, 'process.env.SBVR_SERVER_ENABLED': true, }), diff --git a/src/config-loader/env.ts b/src/config-loader/env.ts index d68b1a723..1e8010d9c 100644 --- a/src/config-loader/env.ts +++ b/src/config-loader/env.ts @@ -1,12 +1,9 @@ -// TODO-MAJOR: Drop the support for the global `DEBUG` env var -const { DEBUG: globalDebug, PINEJS_DEBUG } = process.env; +const { PINEJS_DEBUG } = process.env; if (![undefined, '', '0', '1'].includes(PINEJS_DEBUG)) { // TODO-MAJOR: Throw on invalid value console.warn(`Invalid value for PINEJS_DEBUG '${PINEJS_DEBUG}'`); } -// Setting PINEJS_DEBUG to explicitly '0' will disable debug even if global debug is truthy -export const DEBUG = - PINEJS_DEBUG === '1' || (PINEJS_DEBUG !== '0' && !!globalDebug); +export const DEBUG = PINEJS_DEBUG === '1'; type CacheFnOpts any> = | {