UNPKG

@mintlify/common

Version:

Commonly shared code within Mintlify

8 lines (7 loc) 375 B
/** * Truncates a string at word boundaries to ensure it doesn't exceed the specified length * @param text - The text to truncate * @param maxLength - Maximum allowed length * @returns Truncated text that ends on a complete word, or character-truncated fallback if no word fits */ export declare function truncateAtWordBoundary(text: string, maxLength: number): string;