(items: T[], definitions: TableFieldDefinition<T>[])
| 274 | } |
| 275 | |
| 276 | const buildTableFromList = <T extends object>(items: T[], definitions: TableFieldDefinition<T>[]): string => { |
| 277 | const headingLabels = definitions.map(def => getLabelFor(def)) |
| 278 | const table = newOutputTable({ isList: true, head: headingLabels }) |
| 279 | for (const item of items) { |
| 280 | table.push(definitions.map(def => getDisplayValueFor(item, def))) |
| 281 | } |
| 282 | return table.toString() |
| 283 | } |
| 284 | |
| 285 | return { newOutputTable, buildTableFromItem, buildTableFromList } |
| 286 | } |
nothing calls this directly
no test coverage detected