Skip to content

Commit 4f8ce0b

Browse files
committed
fix another type issue
1 parent 8704e77 commit 4f8ce0b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/core/src/v3/apiClient/runStream.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -508,19 +508,22 @@ if (isSafari()) {
508508
ReadableStream.prototype.values ??= function ({ preventCancel = false } = {}) {
509509
const reader = this.getReader();
510510
return {
511-
async next() {
511+
async next(): Promise<IteratorResult<any>> {
512512
try {
513513
const result = await reader.read();
514514
if (result.done) {
515515
reader.releaseLock();
516516
}
517-
return result;
517+
return {
518+
done: result.done,
519+
value: result.value,
520+
};
518521
} catch (e) {
519522
reader.releaseLock();
520523
throw e;
521524
}
522525
},
523-
async return(value: any) {
526+
async return(value: any): Promise<IteratorResult<any>> {
524527
if (!preventCancel) {
525528
const cancelPromise = reader.cancel(value);
526529
reader.releaseLock();

0 commit comments

Comments
 (0)