UNPKG

everyutil

Version:

A comprehensive library of lightweight, reusable utility functions for JavaScript and TypeScript, designed to streamline common programming tasks such as string manipulation, array processing, date handling, and more.

9 lines (8 loc) 250 B
/** * Truncates a string without cutting off words midway. * @author @dailker * @param {string} str * @param {number} maxWords * @returns {string} */ export declare function stringTruncateByWords(str: string, maxWords: number): string;