mirror of
https://github.com/edcommonwealth/Dashboard.git
synced 2026-03-12 00:20:26 -07:00
12 lines
371 B
TypeScript
12 lines
371 B
TypeScript
const borderedText = (text: string) => {
|
|
const lines = text.split('\n');
|
|
const width = Math.max(...lines.map((l) => l.length));
|
|
const res = [`┌${'─'.repeat(width + 2)}┐`];
|
|
for (const line of lines) {
|
|
res.push(`│ ${line.padEnd(width)} │`);
|
|
}
|
|
res.push(`└${'─'.repeat(width + 2)}┘`);
|
|
return res.join('\n');
|
|
};
|
|
|
|
export default borderedText;
|