Files
blitzkit/src/core/interaction/cleanTable.ts
T

9 lines
329 B
TypeScript
Raw Normal View History

2023-05-20 00:48:52 +00:00
export type TableInputEntry = [string, string | number] | [];
export type TableInput = TableInputEntry[];
2023-05-13 21:42:40 +00:00
export default function cleanTable(input: TableInput) {
return input
.filter((array) => array[1] !== `${-Infinity}`)
.map((array) => (array.length === 0 ? '' : `**${array[0]}**: ${array[1]}`))
.join('\n');
}