Accept iterable in chunk

This commit is contained in:
Jon Staab
2026-02-26 14:58:13 -08:00
parent f1fca2c328
commit 7f257a3fff
+1 -1
View File
@@ -764,7 +764,7 @@ export const initArray = <T>(n: number, f: () => T) => {
* @param xs - Array to split
* @returns Array of chunks
*/
export const chunk = <T>(chunkLength: number, xs: T[]) => {
export const chunk = <T>(chunkLength: number, xs: Iterable<T>) => {
const result: T[][] = []
const current: T[] = []