(filePath: string, onError?: (error: string) => void)
| 5 | |
| 6 | export namespace ConfigFile { |
| 7 | export function readFile(filePath: string, onError?: (error: string) => void): Promise<AppConfigData> { |
| 8 | return new Promise((resolve, reject) => { |
| 9 | readJsonFile(filePath, 'utf8') |
| 10 | .then(json => resolve(parse(json, onError))) |
| 11 | .catch(reject); |
| 12 | }); |
| 13 | } |
| 14 | |
| 15 | export function readFileSync(filePath: string, onError?: (error: string) => void): AppConfigData { |
| 16 | return parse(readJsonFileSync(filePath), onError); |
no test coverage detected