export function dotenvFileLoader(value: string | undefined): Record<string, string> | undefined {
if (!value)
return undefined;
return dotenv.parse(fs.readFileSync(value, 'utf8')); // unguarded
}try {
const data = await fs.promises.readFile(configFile, 'utf8');
return JSON.parse(...);
} catch {
return configFromIniFile(configFile);
}
export function dotenvFileLoader(value: string | undefined): Record<string, string> | undefined {
if (!value)
return undefined;
return dotenv.parse(fs.readFileSync(value, 'utf8')); // unguarded
}try {
const data = await fs.promises.readFile(configFile, 'utf8');
return JSON.parse(...);
} catch {
return configFromIniFile(configFile);
}