diff --git a/lib/assert.js b/lib/assert.js index 8a316ffa793d19..9378631d2763bd 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -61,11 +61,7 @@ assert.AssertionError = function AssertionError(options) { util.inherits(assert.AssertionError, Error); function truncate(s, n) { - if (typeof s === 'string') { - return s.length < n ? s : s.slice(0, n); - } else { - return s; - } + return s.slice(0, n); } function getMessage(self) {