Blame view

node_modules/underscore.string/truncate.js 273 Bytes
f7563de62   Palak Handa   first commit
1
2
3
4
5
6
7
8
  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;
  };