StreamClass.prototype.chunkEvery(): StreamClass<T[], E>
Groups values into arrays of count, sliding by step (Elixir's full
chunk_every/4): step < count overlaps windows, step > count skips between them.
leftover rules the trailing partial chunk: emitted as-is by default, 'discard'
drops it, an array pads it up to count. Failures pass through between chunks
without breaking the one being assembled — a bad row never voids the batch around it.
await Stream.from([1, 2, 3, 4, 5]).chunkEvery(2).collect(); // [[1, 2], [3, 4], [5]] await Stream.from([1, 2, 3, 4, 5]).chunkEvery(3, 2, 'discard').collect(); // [[1, 2, 3], [3, 4, 5]] await Stream.from([1, 2, 3, 4]).chunkEvery(3, 3, [0, 0]).collect(); // [[1, 2, 3], [4, 0, 0]]
StreamClass<T[], E>