code: function truncate(str, options) {
    options = assign({
      length: 24,
      omission: '...'
    }, options);
  
    if (GraphemeBreaker.countBreaks(str) <= options.length) {
      return str;
    }
  
    var length = options.length - options.omission.length;
  
    if (length < 0) {
      length = 0;
    }
  
    return slice(str, 0, length) + options.omission;
  }
docs: Truncates string if it’s longer than the given maximum string length. The last characters of the truncated string are
  replaced with the omission string which defaults to "…".
  Similar to https://lodash.com/docs#trunc but doesn't have the separator option yet.