UNPKG

@utilify/core

Version:

Modern, strongly typed, and safe utility function library for JavaScript and TypeScript. Includes type checking, manipulation of arrays, objects, strings, dates, colors, numbers, regular expressions, and more. Compatible with Browser, Node.js, Deno, and B

18 lines 707 B
/** * Splits a string into chunks of a given size. * @param {string} string - The string to chunk. * @param {number} size - The chunk size. * @returns {string[]} Array of string chunks. * @throws {TypeError} If input is not array-like or size is invalid. */ export default function chunk(string: string, size: number): string[]; /** * Splits an array into chunks of a given size. * @template T * @param {T[]} array - The array to chunk. * @param {number} size - The chunk size. * @returns {T[][]} Array of array chunks. * @throws {TypeError} If input is not array-like or size is invalid. */ export default function chunk<T>(array: T[], size: number): T[][]; //# sourceMappingURL=chunk.d.ts.map