fixed format issues
This commit is contained in:
parent
a700818a06
commit
08f713d98b
55 changed files with 5680 additions and 5533 deletions
|
|
@ -28,10 +28,7 @@ export class ConfigManager<T = Record<string, unknown>> {
|
|||
this.loaders = options.loaders;
|
||||
} else {
|
||||
const configPath = options.configPath || join(process.cwd(), 'config');
|
||||
this.loaders = [
|
||||
new FileLoader(configPath, this.environment),
|
||||
new EnvLoader(''),
|
||||
];
|
||||
this.loaders = [new FileLoader(configPath, this.environment), new EnvLoader('')];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -61,7 +58,11 @@ export class ConfigManager<T = Record<string, unknown>> {
|
|||
const mergedConfig = this.merge(...configs) as T;
|
||||
|
||||
// Add environment if not present
|
||||
if (typeof mergedConfig === 'object' && mergedConfig !== null && !('environment' in mergedConfig)) {
|
||||
if (
|
||||
typeof mergedConfig === 'object' &&
|
||||
mergedConfig !== null &&
|
||||
!('environment' in mergedConfig)
|
||||
) {
|
||||
(mergedConfig as Record<string, unknown>)['environment'] = this.environment;
|
||||
}
|
||||
|
||||
|
|
@ -225,4 +226,4 @@ export class ConfigManager<T = Record<string, unknown>> {
|
|||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue