/
Dante
/
node-core
Обзор
Документация
Войти
/
Dante
/
node-core
Код
Запросы
0
Задачи
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
node_modules/simple-update-notifier/src/borderedText.ts
12 строк
371 B
Александр Данилюк
add
24 сен 2024, 12:59
24 сен 2024, 12:59
9eaeea8
Код
Авторство
О чём код?
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;