diff options
author | Elizabeth Hunt <me@liz.coffee> | 2025-06-20 14:53:38 -0700 |
---|---|---|
committer | Elizabeth Hunt <me@liz.coffee> | 2025-06-20 14:53:38 -0700 |
commit | d4791f3d357634daf506fb8f91cc5332a794c421 (patch) | |
tree | 1bb01d2d4d8fa74d83bb6f99f2c8aa4146ca2d11 /u/leftpadesque/debug.ts | |
parent | d7e8d31c94cd713a2f4cf799e20e993acc69e361 (diff) | |
download | ci-d4791f3d357634daf506fb8f91cc5332a794c421.tar.gz ci-d4791f3d357634daf506fb8f91cc5332a794c421.zip |
Move to nodejs
Diffstat (limited to 'u/leftpadesque/debug.ts')
-rw-r--r-- | u/leftpadesque/debug.ts | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/u/leftpadesque/debug.ts b/u/leftpadesque/debug.ts index e50b2e0..074e567 100644 --- a/u/leftpadesque/debug.ts +++ b/u/leftpadesque/debug.ts @@ -1,13 +1,8 @@ -const _hasEnv = !Deno.permissions.querySync({ name: "env" }); +const _hasEnv = true; // Node.js always has access to environment variables -const _env: "development" | "production" = - _hasEnv && (Deno.env.get("ENVIRONMENT") ?? "").toLowerCase().includes("prod") - ? "production" - : "development"; -export const isProd = () => _env === "production"; +const _env: 'development' | 'production' = + _hasEnv && (process.env.ENVIRONMENT ?? '').toLowerCase().includes('prod') ? 'production' : 'development'; +export const isProd = () => _env === 'production'; -const _debug = - !isProd() || - (_hasEnv && - ["y", "t"].some((Deno.env.get("DEBUG") ?? "").toLowerCase().startsWith)); +const _debug = !isProd() || (_hasEnv && ['y', 't'].some((process.env.DEBUG ?? '').toLowerCase().startsWith)); export const isDebug = () => _debug; |