truncate-smart.d.ts 594 B

12345678910111213
  1. /**
  2. * Date: 2015-10-05
  3. * Author: Kasper Søfren <soefritz@gmail.com> (https://github.com/kafoso)
  4. *
  5. * A truncation feature, where the ellipsis will be placed at a section within
  6. * the URL making it still somewhat human readable.
  7. *
  8. * @param {String} url A URL.
  9. * @param {Number} truncateLen The maximum length of the truncated output URL string.
  10. * @param {String} ellipsisChars The characters to place within the url, e.g. "...".
  11. * @return {String} The truncated URL.
  12. */
  13. export declare function truncateSmart(url: string, truncateLen: number, ellipsisChars?: string): string;