1
0
Fork 0
mirror of synced 2024-10-05 12:34:50 +13:00

Fix possible nulls

This commit is contained in:
adrinr 2023-02-01 15:02:31 +00:00
parent 1d8c27bdc4
commit e6dda787ae

View file

@ -1,10 +1,13 @@
function getTestContainerSettings(serverName: string, key: string) {
const [_, value] = Object.entries(global).find(
const entry = Object.entries(global).find(
([k]) =>
k.includes(`_${serverName.toUpperCase()}`) &&
k.includes(`_${key.toUpperCase()}__`)
)!
return value
)
if (!entry) {
return null
}
return entry[1]
}
function getCouchConfig() {
@ -31,7 +34,7 @@ export function setupEnv(...envs: any[]) {
{ key: "MINIO_URL", value: getMinioConfig().url },
]
for (const config of configs) {
for (const config of configs.filter(x => x.value !== null)) {
for (const env of envs) {
env._set(config.key, config.value)
}