We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26717a6 commit 5bbe29dCopy full SHA for 5bbe29d
src/raven.js
@@ -561,8 +561,9 @@ function objectMerge(obj1, obj2) {
561
}
562
563
function truncate(str, max) {
564
+ var before = str.length;
565
str = str.substr(0, max);
- if (str.length === max) {
566
+ if (str.length !== before) {
567
str += '…';
568
569
return str;
test/raven.test.js
@@ -204,6 +204,7 @@ describe('globals', function() {
204
it('should work as advertised', function() {
205
assert.equal(truncate('lolol', 3), 'lol…');
206
assert.equal(truncate('lolol', 10), 'lolol');
207
+ assert.equal(truncate('lol', 3), 'lol');
208
});
209
210
0 commit comments