Skip to content

Commit 909d9a8

Browse files
committed
refactor: simplify
1 parent 554e919 commit 909d9a8

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

src/config/configAggregator.ts

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -449,18 +449,13 @@ export class ConfigAggregator extends AsyncOptionalCreatable<ConfigAggregator.Op
449449

450450
// Global config must be read first so it is on the left hand of the
451451
// object assign and is overwritten by the local config.
452-
453-
const configs = [globalConfig];
454-
455-
// We might not be in a project workspace
456-
if (localConfig) {
457-
configs.push(localConfig);
458-
}
459-
460-
configs.push(this.envVars);
461-
462-
const json: JsonMap = {};
463-
return configs.filter(isJsonMap).reduce((acc: JsonMap, el: AnyJson) => merge(acc, el), json);
452+
return [
453+
globalConfig,
454+
...(localConfig ? [localConfig] : []), // We might not be in a project workspace
455+
this.envVars,
456+
]
457+
.filter(isJsonMap)
458+
.reduce((acc: JsonMap, el: AnyJson) => merge(acc, el), {});
464459
}
465460
}
466461

0 commit comments

Comments
 (0)