Blame view
node_modules/underscore.string/truncate.js
273 Bytes
f7563de62
|
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; }; |