mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-04 19:15:33 +08:00
91c3040db7
Co-authored-by: himself65 <himself65@outlook.com>
16 lines
400 B
TypeScript
16 lines
400 B
TypeScript
import { set } from 'lodash-es';
|
|
|
|
import { parseEnvValue } from './def';
|
|
|
|
for (const env in AFFiNE.ENV_MAP) {
|
|
const config = AFFiNE.ENV_MAP[env];
|
|
const [path, value] =
|
|
typeof config === 'string'
|
|
? [config, process.env[env]]
|
|
: [config[0], parseEnvValue(process.env[env], config[1])];
|
|
|
|
if (typeof value !== 'undefined') {
|
|
set(globalThis.AFFiNE, path, process.env[env]);
|
|
}
|
|
}
|