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

9 lines
324 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
2023-06-02 01:31:14 +00:00
.filter((array) => array[1] !== undefined)
2023-05-13 21:42:40 +00:00
.map((array) => (array.length === 0 ? '' : `**${array[0]}**: ${array[1]}`))
.join('\n');
}