(text: string, maxLength = MAX_ITEM_TEXT)
| 32 | } |
| 33 | |
| 34 | export function truncateText(text: string, maxLength = MAX_ITEM_TEXT) { |
| 35 | if (text.length <= maxLength) { |
| 36 | return text; |
| 37 | } |
| 38 | const sliceLength = Math.max(0, maxLength - 3); |
| 39 | return `${text.slice(0, sliceLength)}...`; |
| 40 | } |
| 41 | |
| 42 | export function truncateToolText(toolType: string, text: string) { |
| 43 | const maxLength = LARGE_TOOL_TYPES.has(toolType) |
no outgoing calls
no test coverage detected