Improve report format to save space

This commit is contained in:
Michal Dorner 2021-01-25 14:21:44 +01:00
parent 768aefbed2
commit e3bb634029
No known key found for this signature in database
GPG key ID: 9EEE04B48DA36786
8 changed files with 504 additions and 504 deletions

View file

@ -11,19 +11,15 @@ export const Icon = {
fail: '❌' // ':x:'
}
export function details(summary: string, content: string): string {
return `<details><summary>${summary}</summary>${content}</details>`
}
export function link(title: string, address: string): string {
return `[${title}](${address})`
}
type ToString = string | number | boolean | Date
export function table(headers: ToString[], align: ToString[], ...rows: ToString[][]): string {
const headerRow = `| ${headers.map(tableEscape).join(' | ')} |`
const alignRow = `| ${align.join(' | ')} |`
const contentRows = rows.map(row => `| ${row.map(tableEscape).join(' | ')} |`).join('\n')
const headerRow = `|${headers.map(tableEscape).join('|')}|`
const alignRow = `|${align.join('|')}|`
const contentRows = rows.map(row => `|${row.map(tableEscape).join('|')}|`).join('\n')
return [headerRow, alignRow, contentRows].join('\n')
}