(options: {
warnings?: readonly DiagnosticInput[];
errors?: readonly DiagnosticInput[];
rawOutput?: readonly string[] | string;
})
| 32 | } |
| 33 | |
| 34 | export function createBasicDiagnostics(options: { |
| 35 | warnings?: readonly DiagnosticInput[]; |
| 36 | errors?: readonly DiagnosticInput[]; |
| 37 | rawOutput?: readonly string[] | string; |
| 38 | }): BasicDiagnostics { |
| 39 | const diagnostics: BasicDiagnostics = { |
| 40 | warnings: normalizeDiagnosticEntries(options.warnings), |
| 41 | errors: normalizeDiagnosticEntries(options.errors), |
| 42 | }; |
| 43 | |
| 44 | const rawOutputInput = options.rawOutput; |
| 45 | const rawOutput = |
| 46 | typeof rawOutputInput === 'string' |
| 47 | ? nonEmptyLines(rawOutputInput) |
| 48 | : rawOutputInput !== undefined |
| 49 | ? rawOutputInput.filter(isNonEmptyText) |
| 50 | : []; |
| 51 | |
| 52 | if (rawOutput.length > 0) { |
| 53 | diagnostics.rawOutput = rawOutput; |
| 54 | } |
| 55 | |
| 56 | return diagnostics; |
| 57 | } |
| 58 | |
| 59 | export function diagnosticsFromErrorMessage(message: string): BasicDiagnostics { |
| 60 | return createBasicDiagnostics({ |
no test coverage detected