import { splitText } from './splitText' ; param str param length copyright license export function cutText ( str , length ) { if ( str . length < length ) return str ; const cut = splitText ( str , length - 3 ) ; if ( cut . length < length - 3 ) return `${ cut }...` ; return `${ cut . slice ( 0 , length - 3 ) }...` ; }