(filePath: string, data: AppExtConfigData)
| 31 | } |
| 32 | |
| 33 | export function saveFile(filePath: string, data: AppExtConfigData): Promise<void> { |
| 34 | return new Promise((resolve, reject) => { |
| 35 | // Convert config to json string |
| 36 | const json: string = stringifyJsonDataFile(data); |
| 37 | // Save the config file |
| 38 | fs.writeFile(filePath, json, function(error) { |
| 39 | if (error) { return reject(error); } |
| 40 | else { return resolve(); } |
| 41 | }); |
| 42 | }); |
| 43 | } |
| 44 | |
| 45 | function parse(json: any): AppExtConfigData { |
| 46 | return overwriteExtConfigData({}, json); |
no test coverage detected