(property: AnyPropertyReport, index: number, format: TableFormat)
| 110 | } |
| 111 | |
| 112 | function formatPropertyReport(property: AnyPropertyReport, index: number, format: TableFormat): Record<string, string> { |
| 113 | const row: Record<string, string | number> = { '#': index }; |
| 114 | for (const key in property) { |
| 115 | const value = (property as unknown as Record<string, string | number>)[key]; |
| 116 | if (Array.isArray(value)) { |
| 117 | row[key] = value.join(', '); |
| 118 | } else if (key.match(/size/i) && format !== TableFormat.CSV) { |
| 119 | row[key] = (value as number) > 0 ? formatBytes(value as number) : ''; |
| 120 | } else if (typeof value === 'number') { |
| 121 | row[key] = format !== TableFormat.CSV ? formatLong(value) : value; |
| 122 | } else if (typeof value === 'boolean') { |
| 123 | row[key] = value ? '✓' : ''; |
| 124 | } else { |
| 125 | row[key] = value; |
| 126 | } |
| 127 | } |
| 128 | return row as Record<string, string>; |
| 129 | } |
| 130 | |
| 131 | function getFootnotes(type: string, header: string[]): string[] { |
| 132 | const footnotes = []; |
no test coverage detected