(diagnostics?: d.Diagnostic[])
| 12 | * @returns the created `Diagnostic` |
| 13 | */ |
| 14 | export const buildError = (diagnostics?: d.Diagnostic[]): d.Diagnostic => { |
| 15 | const diagnostic: d.Diagnostic = { |
| 16 | level: 'error', |
| 17 | type: 'build', |
| 18 | header: 'Build Error', |
| 19 | messageText: 'build error', |
| 20 | relFilePath: undefined, |
| 21 | absFilePath: undefined, |
| 22 | lines: [], |
| 23 | }; |
| 24 | |
| 25 | if (diagnostics) { |
| 26 | diagnostics.push(diagnostic); |
| 27 | } |
| 28 | |
| 29 | return diagnostic; |
| 30 | }; |
| 31 | |
| 32 | /** |
| 33 | * Builds a template `Diagnostic` entity for a build warning. The created `Diagnostic` is returned, and have little |
no test coverage detected