source: node_modules/simple-update-notifier/src/borderedText.ts@ 33517cc

finki-main main
Last change on this file since 33517cc was 81bc7da, checked in by Klimentina Efremova <klimentina08642@…>, 3 months ago

Initial commit

  • Property mode set to 100644
File size: 371 bytes
Line 
1const borderedText = (text: string) => {
2 const lines = text.split('\n');
3 const width = Math.max(...lines.map((l) => l.length));
4 const res = [`┌${'─'.repeat(width + 2)}┐`];
5 for (const line of lines) {
6 res.push(`│ ${line.padEnd(width)} │`);
7 }
8 res.push(`└${'─'.repeat(width + 2)}┘`);
9 return res.join('\n');
10};
11
12export default borderedText;
Note: See TracBrowser for help on using the repository browser.