feat(storage): binding jwst storage to node (#2808)

This commit is contained in:
liuyi
2023-06-29 09:45:45 +08:00
committed by GitHub
parent 86616e152d
commit 2c95bfcc3d
40 changed files with 5621 additions and 98 deletions

View File

@@ -2,14 +2,16 @@ 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])];
export function registerEnvs() {
for (const env in globalThis.AFFiNE.ENV_MAP) {
const config = globalThis.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]);
if (typeof value !== 'undefined') {
set(globalThis.AFFiNE, path, process.env[env]);
}
}
}