Skip to content

Commit b41f706

Browse files
committed
Pro at JavaScript
1 parent 5bbe29d commit b41f706

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/raven.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -561,12 +561,7 @@ function objectMerge(obj1, obj2) {
561561
}
562562

563563
function truncate(str, max) {
564-
var before = str.length;
565-
str = str.substr(0, max);
566-
if (str.length !== before) {
567-
str += '…';
568-
}
569-
return str;
564+
return str.length <= max ? str : str.substr(0, max) + '…';
570565
}
571566

572567
function getHttpData() {

0 commit comments

Comments
 (0)