UNPKG

use-truncate-from-middle

Version:

React hook which dynamically calculates the maximum number of characters that fit into an HTML element and truncates the text from middle with given middle chars.

2 lines (1 loc) 119 B
export declare const truncateFromMiddle: (fullStr: string | undefined, strLen: number, separator?: string) => string;