()
| 1 | import { Cfg } from '../app/Config' |
| 2 | |
| 3 | export function retrieveReactEnvCfg(): Record<string, string> { |
| 4 | const env = process.env |
| 5 | const keys = Object.keys(env) |
| 6 | const reactKeys = keys.filter(key => { |
| 7 | return key.startsWith(Cfg.PREFIX) || key === 'PUBLIC_URL' |
| 8 | }) |
| 9 | |
| 10 | const envCfg: Record<string, string> = {} |
| 11 | for (const key of reactKeys) { |
| 12 | // @ts-ignore |
| 13 | envCfg[key] = process.env[key] |
| 14 | } |
| 15 | return envCfg |
| 16 | } |
| 17 | |
| 18 | export function retrieveDotEnvCfg(): Record<string, string> { |
| 19 | // eslint-disable-next-line @typescript-eslint/no-var-requires |
no outgoing calls
no test coverage detected