Files
med-notes/.pnpm-store/v10/files/74/16893fbcd0cd71b1c9a15cfcac988b61737811b7f33a7b987eeddc94c9b2c1a7ae79b4bf707fffaf95149e93bc8b64bd8d528859682689787e4761f0d85853
2025-06-26 03:35:15 +00:00

13 lines
371 B
Plaintext

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;