(inputs: readonly DiagnosticInput[] = [])
| 16 | } |
| 17 | |
| 18 | function normalizeDiagnosticEntries(inputs: readonly DiagnosticInput[] = []): DiagnosticEntry[] { |
| 19 | return inputs.flatMap((input) => { |
| 20 | if (typeof input === 'string') { |
| 21 | const message = normalizeDiagnosticMessage(input); |
| 22 | return isNonEmptyText(message) ? [{ message }] : []; |
| 23 | } |
| 24 | |
| 25 | const message = normalizeDiagnosticMessage(input.message); |
| 26 | return isNonEmptyText(message) ? [{ ...input, message }] : []; |
| 27 | }); |
| 28 | } |
| 29 | |
| 30 | export function nonEmptyLines(text: string): string[] { |
| 31 | return text.split(/\r?\n/).filter(isNonEmptyText); |
no test coverage detected