Allow returning empty strings

This commit is contained in:
Lukas Hass 2022-01-24 11:54:00 +01:00
parent 7863774dca
commit 6f24780874
No known key found for this signature in database
GPG Key ID: 7C8CEF72C4039178

View File

@ -5,14 +5,13 @@ declare global {
}
const getEnv = (key: string): string | undefined => {
if (global.window?.env) {
return global.window.env[key];
}
if (global.process?.env) {
return global.process.env[key];
}
const value = global.window.env[key];
if (value === "") {
return;
}
return value;
};
const DEBUG_MODE: boolean = getEnv("DEBUG_MODE") == "true";