Return value from process.env if it exists
This commit is contained in:
parent
00464f7144
commit
7863774dca
@ -5,8 +5,8 @@ declare global {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getEnv = (key: string): string | undefined => {
|
const getEnv = (key: string): string | undefined => {
|
||||||
if (!global.window || !global.window.env) {
|
if (global.process?.env) {
|
||||||
return;
|
return global.process.env[key];
|
||||||
}
|
}
|
||||||
const value = global.window.env[key];
|
const value = global.window.env[key];
|
||||||
if (value === "") {
|
if (value === "") {
|
||||||
|
Loading…
Reference in New Issue
Block a user