Files
blitzkit/src/LEGACY_core/discord/markdownTable.ts
T
2023-10-14 11:06:03 -05:00

10 lines
327 B
TypeScript

export type TableInputEntry = [string, string | number] | [];
export type TableInput = TableInputEntry[];
export default function markdownTable(input: TableInput) {
return input
.filter((array) => array[1] !== undefined)
.map((array) => (array.length === 0 ? '' : `**${array[0]}**: ${array[1]}`))
.join('\n');
}