tooot/src/modules/autolinker/truncate/truncate-middle.d.ts

13 lines
562 B
TypeScript

/**
* Date: 2015-10-05
* Author: Kasper Søfren <soefritz@gmail.com> (https://github.com/kafoso)
*
* A truncation feature, where the ellipsis will be placed in the dead-center of the URL.
*
* @param {String} url A URL.
* @param {Number} truncateLen The maximum length of the truncated output URL string.
* @param {String} ellipsisChars The characters to place within the url, e.g. "..".
* @return {String} The truncated URL.
*/
export declare function truncateMiddle(url: string, truncateLen: number, ellipsisChars?: string): string;