Return value from process.env if it exists

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

View File

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