File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -919,7 +919,7 @@ async function connect<SingleConnection extends boolean>(
919
919
const parse = createParser < SingleConnection > ( ) ;
920
920
921
921
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
922
- for await ( const chunk of toAsyncIterator ( res . body ! ) ) {
922
+ for await ( const chunk of toAsyncIterable ( res . body ! ) ) {
923
923
if ( typeof chunk === 'string' )
924
924
throw ( error = new Error ( `Unexpected string chunk "${ chunk } "` ) ) ; // set error as fatal indicator
925
925
@@ -1031,13 +1031,13 @@ async function connect<SingleConnection extends boolean>(
1031
1031
}
1032
1032
1033
1033
/** Isomorphic ReadableStream to AsyncIterator converter. */
1034
- function toAsyncIterator (
1034
+ function toAsyncIterable (
1035
1035
val : ReadableStream | NodeJS . ReadableStream ,
1036
1036
) : AsyncIterable < string | Buffer | Uint8Array > {
1037
1037
// node stream is already async iterable
1038
1038
if ( typeof Object ( val ) [ Symbol . asyncIterator ] === 'function' ) {
1039
1039
val = val as NodeJS . ReadableStream ;
1040
- return val [ Symbol . asyncIterator ] ( ) ;
1040
+ return val ;
1041
1041
}
1042
1042
1043
1043
// convert web stream to async iterable
You can’t perform that action at this time.
0 commit comments