(str: string, sliceLength: number, suffix = '...')
| 9 | * truncate('hi', 10) // 'hi' |
| 10 | */ |
| 11 | export function truncate(str: string, sliceLength: number, suffix = '...'): string { |
| 12 | return str.length > sliceLength ? str.slice(0, sliceLength) + suffix : str |
| 13 | } |
| 14 | |
| 15 | /** |
| 16 | * Strips a trailing `_vN` version suffix from `value`, yielding the base type. |
no outgoing calls
no test coverage detected