10 lines
211 B
JavaScript
10 lines
211 B
JavaScript
"use strict";
|
|
function truncateString(str) {
|
|
const maxLength = 400;
|
|
if (str.length > maxLength) {
|
|
return str.substring(0, maxLength) + "...";
|
|
}
|
|
return str;
|
|
}
|
|
exports.truncateString = truncateString;
|