(file: HttpImportFile, warnings: HttpImportWarning[])
| 37 | } |
| 38 | |
| 39 | function readJsonFile(file: HttpImportFile, warnings: HttpImportWarning[]) { |
| 40 | try { |
| 41 | return JSON.parse(file.content) as unknown |
| 42 | } |
| 43 | catch { |
| 44 | addWarning(warnings, file.name, 'Invalid JSON skipped') |
| 45 | return null |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | function isJsonFile(file: HttpImportFile): boolean { |
| 50 | return file.name.toLowerCase().endsWith('.json') |
no test coverage detected