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.

12 lines (11 loc) 412 B
/** * Splits a string into fixed-size word chunks. * * Example: chunkWords("This is a test string", 2) → [["This", "is"], ["a", "test"], ["string"]] * * @author @dailker * @param {string} str - The input string. * @param {number} count - Number of words per chunk. * @returns {string[][]} Array of word chunks. */ export declare function chunkWords(str: string, count: number): string[][];