You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
371 B
13 lines
371 B
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;
|