@poppinss/string
Version:
A collection of helpers to perform operations on/related to a string value
12 lines (11 loc) • 375 B
TypeScript
/**
* Truncate a sentence to be under the given characters limit and strip
* out HTML tags from it.
*
* Optionally, you can force the truncate logic to complete words, which
* may exceed the defined characters limit.
*/
export declare function excerpt(sentence: string, charactersLimit: number, options?: {
completeWords?: boolean;
suffix?: string;
}): string;