2
0
Files
bot/packages/env/getRuntimeVariable.ts
2023-08-31 09:57:54 +02:00

11 lines
270 B
TypeScript

declare const window: {
__ENV?: any
}
export const getRuntimeVariable = (key: string) => {
if (typeof window !== 'undefined')
return window.__ENV ? window.__ENV[key] : undefined
if (typeof process === 'undefined') return undefined
return process.env[key]
}