StreamClass.prototype.chunkBy(key: (value: T) => unknown): StreamClass<T[], E>
Chunks consecutive values sharing a key — Elixir's chunk_by/2; a key change closes
the chunk. Failures are transparent: they pass through without closing the chunk
around them, consistent with dedup.
await Stream.from([1, 3, 2, 4, 5]).chunkBy((n) => n % 2).collect(); // [[1, 3], [2, 4], [5]]
key: (value: T) => unknown
StreamClass<T[], E>