fix: mistyping of stream#4400
Conversation
|
@monotykamary Is it possible to adjust type instead of removing it? |
|
@kibertoad without AsyncIterable the |
|
@nguymin4 Breaking the type is also bad practice, especially since the stream returns a
In that case, it might just make sense by intersecting both types: stream(): stream.PassThrough & AsyncIterable<ArrayMember<T>>; |
|
@monotykamary Could you adjust the PR to do the intersection? |
|
The intersection will not work. It doesn't resolve the type of |
|
Ok seems to work now. So we can merge those two stream methods into one. @monotykamary Could you also add a test for the I forgot to add this in previous PR which caused the issue. |
5f43389 to
bf15784
Compare
Adds upon knex#4377 by intersecting the `stream.PassThrough` class to maintain the stream type.
bf15784 to
30941bb
Compare
nguymin4
left a comment
There was a problem hiding this comment.
Looks good to me!
Please fix the test. Probably missing import.



Reverts a breaking type change tostreamfrom #4377. Thestreammethod returns aninstance of
stream.Passthroughor allows a callback of an instancestream.Passthroughthat returns aPromiseas per documentation. This is not interchangeable withAsyncIterableasReadablealready implementsAsyncIterableIterator.Adds upon #4377 by intersecting the
stream.PassThroughclass to maintain the stream type.