refactoring and adding limit command option

This commit is contained in:
2023-01-14 21:44:02 -03:00
parent 205b865592
commit 25bd8f306b
9 changed files with 159 additions and 130 deletions

5
scripts/truncateText.js Normal file
View File

@@ -0,0 +1,5 @@
function truncateText(text, max) {
return text.substr(0, max - 1).trim() + (text.length > max ? '...' : '');
}
module.exports = truncateText;