MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / getConfigFile

Method getConfigFile

packages/cli/src/CLIHelper.ts:185–197  ·  view source on GitHub ↗
(paths: string[])

Source from the content-addressed store, hash-verified

183 }
184
185 private static async getConfigFile(paths: string[]): Promise<[string, unknown] | []> {
186 for (let path of paths) {
187 path = fs.absolutePath(path);
188 path = fs.normalizePath(path);
189
190 if (fs.pathExists(path)) {
191 const config = await fs.dynamicImport(path);
192 /* v8 ignore next */
193 return [path, await (config.default ?? config)];
194 }
195 }
196 return [];
197 }
198
199 private static async loadEnvironmentVars<D extends IDatabaseDriver>(): Promise<Partial<Options<D>>> {
200 const ret = loadEnvironmentVars();

Callers 1

getConfigurationMethod · 0.95

Calls 4

absolutePathMethod · 0.80
normalizePathMethod · 0.80
pathExistsMethod · 0.80
dynamicImportMethod · 0.80

Tested by

no test coverage detected