From cb41c68f77eca6d36f34d09652bd010c143a6169 Mon Sep 17 00:00:00 2001 From: Mathis Date: Thu, 2 May 2024 14:11:48 +0200 Subject: [PATCH] feat(utils): add debug state utility This commit includes the creation of a new utility file for checking if the app is running in debugging mode. It exports `isDebugMode()` function that checks the `DEBUG` environment variable's value. Signed-off-by: Mathis --- src/utils/debugState.ts | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/utils/debugState.ts diff --git a/src/utils/debugState.ts b/src/utils/debugState.ts new file mode 100644 index 0000000..d5b725b --- /dev/null +++ b/src/utils/debugState.ts @@ -0,0 +1,9 @@ +import process from "node:process"; + + +export function isDebugMode() { + if (process.env["DEBUG"] === 'true') { + return true; + } + return false; +} \ No newline at end of file