mirror of
https://github.com/FranP-code/shopping-discord-bot.git
synced 2025-10-13 00:22:44 +00:00
5 lines
143 B
JavaScript
5 lines
143 B
JavaScript
function truncateText(text, max) {
|
|
return text.substr(0, max - 1).trim() + (text.length > max ? '...' : '');
|
|
}
|
|
|
|
module.exports = truncateText; |