src/string/truncate.js
function truncate (value, length) {
  length = length || 15
  if( !value || typeof value !== 'string' ) return ''
  if( value.length <= length) return value
  return value.substring(0, length) + '...'
}
function truncate (value, length) {
  length = length || 15
  if( !value || typeof value !== 'string' ) return ''
  if( value.length <= length) return value
  return value.substring(0, length) + '...'
}
function truncate ( value , length ) { length = length || 15 if ( ! value || typeof value !== 'string' ) return '' if ( value . length <= length ) return value return value . substring ( 0 , length ) + '...' }
Truncate at the given || default length

'lorem ipsum dolor' => 'lorem ipsum dol...'
Truncate at the given || default length