opusdev/vector-similarity-api
1
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;13 