Implement transform.divide()
Divide the elements of the iterable evenly into n smaller iterables, maintaining order. Ex: ([1, 2, 3, 4], 2) => [1, 2], [3, 4]
function *divide<T>(data: Iterable<T> | Iterator<T>, n: number): Iterable<Array<T>>
Needs to be implemented:
transform.divide()transform.divideAsync()Stream.divide()AsyncStream.divide()
Hi @Smoren Can you assign this issue to me if the issue is still open?
Hi @DaBestCode You're welcome!
Hi @Smoren can you assign this to me or can I just work on it?
Hi @DaBestCode! Done.
Thanks @Smoren . I have started writing divide and divideAsync. I just need a clarification. Because the issue shows a *,should the function be a generator or a normal function?
Hi @DaBestCode! All the functions must be generators.
Hi @Smoren I have put up a PR with all the runs passing the test cases. So, is this issue closed?
Hi @DaBestCode! I'll close this issue when the PR is merged.
Hi @Smoren I have rebased and took care of the conflicts. I am done with the tests for transform/divide.test.ts. I believe I have to write tests for stream and async-stream too but I am not understanding where to write them can you guide me on this issue.
Hi @DaBestCode
/tests/stream/transform.test.ts/tests/async-stream/transform.test.ts