feat: replace full ASCII box w/ only top and bottom to allow copy
This commit is contained in:
parent
a6827772a5
commit
eb5eeed1c7
|
|
@ -18,9 +18,9 @@ export function wrapInASCIIBox(text: string, padding = 0): string {
|
||||||
const lines = text.split('\n');
|
const lines = text.split('\n');
|
||||||
const maxLength = Math.max(...lines.map(line => line.length));
|
const maxLength = Math.max(...lines.map(line => line.length));
|
||||||
return [
|
return [
|
||||||
'╔' + '═'.repeat(maxLength + padding * 2) + '╗',
|
'═'.repeat(maxLength + padding * 2),
|
||||||
...lines.map(line => '║' + ' '.repeat(padding) + line + ' '.repeat(maxLength - line.length + padding) + '║'),
|
...lines.map(line => ' '.repeat(padding) + line + ' '.repeat(maxLength - line.length + padding)),
|
||||||
'╚' + '═'.repeat(maxLength + padding * 2) + '╝',
|
'═'.repeat(maxLength + padding * 2),
|
||||||
].join('\n');
|
].join('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue