(jsonFolder: string, onError?: (error: string) => void)
| 19 | * @param onError Called for each error that occurs while parsing. |
| 20 | */ |
| 21 | export function readFile(jsonFolder: string, onError?: (error: string) => void): Promise<UpgradeStage[]> { |
| 22 | return new Promise((resolve, reject) => { |
| 23 | readJsonFile(path.join(jsonFolder, filePath), fileEncoding) |
| 24 | .then(json => resolve(parseFile(json, onError))) |
| 25 | .catch(reject); |
| 26 | }); |
| 27 | } |
| 28 | |
| 29 | function parseFile(data: any, onError?: (error: string) => void): UpgradeStage[] { |
| 30 | const parser = new ObjectParser({ |
nothing calls this directly
no test coverage detected