UNPKG

@seasketch/geoprocessing

Version:

Geoprocessing and reporting framework for SeaSketch 2.0

10 lines (9 loc) 255 B
/** * Splits an array into chunks of size */ export function chunk<T>(array: T[], chunkSize: number): T[][] { const R: any[] = []; for (let i = 0, len = array.length; i < len; i += chunkSize) R.push(array.slice(i, i + chunkSize)); return R; }