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

8 lines
284 B
TypeScript
Raw Normal View History

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