Skip to content

Commit

Permalink
fix(streaming): fix response body streaming in non-Chrome environments (
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot authored Jul 9, 2023
1 parent 6eb4b6b commit df627aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/streaming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ function partition(str: string, delimiter: string): [string, string, string] {
* This polyfill was pulled from https://github.com/MattiasBuelens/web-streams-polyfill/pull/122#issuecomment-1624185965
*/
function readableStreamAsyncIterable<T>(stream: any): AsyncIterableIterator<T> {
if (stream[Symbol.asyncIterator]) return stream[Symbol.asyncIterator];
if (stream[Symbol.asyncIterator]) return stream;

const reader = stream.getReader();
return {
Expand Down

0 comments on commit df627aa

Please sign in to comment.