3 // Truncates inputText to the desired length and adds ellipsis if the text is overflowing
4 // Ellipsis are inclusive to the desired length
5 function truncateText(inputText = '', length) {
6 if (inputText.length > length) {
7 return inputText.substring(0, length - 3) + '...';
13 module.exports = truncateText;