function truncate (str, showChar = 7) {
  if (str && str.length > 0) {
    const visiblePart = str.slice(0, showChar)
    return visiblePart + '…'
  } else {
    return ''
  }
}

module.exports = truncate
