({ headline, lines = [], quoted = false, meta = [] } = {})
| 24 | } |
| 25 | |
| 26 | export function buildLogDescription({ headline, lines = [], quoted = false, meta = [] } = {}) { |
| 27 | const parts = []; |
| 28 | |
| 29 | if (headline) { |
| 30 | parts.push(headline); |
| 31 | } |
| 32 | |
| 33 | if (lines.length > 0) { |
| 34 | parts.push(quoted ? buildQuotedBlock(lines) : lines.join('\n')); |
| 35 | } |
| 36 | |
| 37 | if (meta.length > 0) { |
| 38 | parts.push(formatMetaLine(meta)); |
| 39 | } |
| 40 | |
| 41 | return parts.join('\n\n').slice(0, 4096); |
| 42 | } |
| 43 | |
| 44 | export function fieldsToLines(fields = []) { |
| 45 | return fields.map((field) => formatLogLine(stripFieldLabel(field.name), field.value)); |
no test coverage detected