Code coverage report for master/truncate.js

Statements: 100% (6 / 6)      Branches: 100% (4 / 4)      Functions: 100% (1 / 1)      Lines: 100% (6 / 6)      Ignored: none     

All files » master/ » truncate.js
1 2 3 4 5 6 7 8 91   1 7 7 7 7    
var makeString = require('./helper/makeString');
 
module.exports = function truncate(str, length, truncateStr) {
  str = makeString(str);
  truncateStr = truncateStr || '...';
  length = ~~length;
  return str.length > length ? str.slice(0, length) + truncateStr : str;
};