(fileMap: FileMap)
| 10 | * To ensure it is clear that this is generated code and shall not be lint checked. |
| 11 | */ |
| 12 | export function addPreambleToJSFiles(fileMap: FileMap) { |
| 13 | for (const [key, value] of Object.entries(fileMap)) { |
| 14 | if (typeof value === 'string' && (key.endsWith('.js') || key.endsWith('.mjs'))) { |
| 15 | fileMap[key] = addPreamble(value) |
| 16 | } else if (typeof value === 'object' && value !== null) { |
| 17 | addPreambleToJSFiles(value) |
| 18 | } |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | export function addPreamble(fileContent: string) { |
| 23 | return generatedCodePreamble + fileContent |
no test coverage detected