chunk
chunk<
T>(items,size):T[][]
Defined in: packages/simply-core/src/collection/chunk.ts:31
Split an array into consecutive chunks of at most size elements.
Salesforce work is full of batch limits — how many IDs fit in a WHERE Id IN (...) clause
before the query gets too long, how many records the Tooling API will delete in one call — and
each of those limits ends up as the same hand-written index loop. This is that loop, once.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”readonly T[]
The items to split. Not mutated.
number
Maximum number of items per chunk. Must be at least 1.
Returns
Section titled “Returns”T[][]
The chunks, in order. Empty if items is empty.
Throws
Section titled “Throws”If size is less than 1.