Files
page-agent/packages/ui/src/utils.ts
T

7 lines
164 B
TypeScript
Raw Normal View History

export function truncate(text: string, maxLength: number): string {
if (text.length > maxLength) {
return text.substring(0, maxLength) + '...'
}
return text
}