(jsonFolder: string, config: AppConfigData, onError?: (error: string) => void)
| 22 | * @param onError Called for each error that occurs while parsing. |
| 23 | */ |
| 24 | export function readFile(jsonFolder: string, config: AppConfigData, onError?: (error: string) => void): Promise<ServiceFileData> { |
| 25 | return new Promise((resolve, reject) => { |
| 26 | readJsonFile(path.join(jsonFolder, filePath), fileEncoding) |
| 27 | .then(json => resolve(parseServiceFileData(json, config, onError))) |
| 28 | .catch(reject); |
| 29 | }); |
| 30 | } |
| 31 | |
| 32 | function parseServiceFileData(data: any, config: AppConfigData, onError?: (error: string) => void): ServiceFileData { |
| 33 | const parsed: ServiceFileData = { |
nothing calls this directly
no test coverage detected