Skip to content

Commit

Permalink
typescript noUnusedLocals
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfant committed Jul 26, 2024
1 parent 71cece7 commit fc0a732
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion src/baseClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export abstract class ApiClient {

buildRequest(opts: FinalRequestOptions): { req: RequestInit, url: string } {
const url = new URL(this.baseURL + opts.path!)
const { method, path, query, headers: headers = {}, body } = opts;
const { method, body } = opts;
const reqHeaders: Record<string, string> = {
...this.defaultHeaders(), ...this.customHeaders,
};
Expand Down
3 changes: 0 additions & 3 deletions src/streaming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,9 @@ export class Stream<Item> implements AsyncIterable<Item> {
}

async *[Symbol.asyncIterator](): AsyncIterator<Item, any, undefined> {
let done = false;
try {
for await (const sse of this.iterMessages()) {
if (sse.data.startsWith('[DONE]')) {
done = true;
continue;
}
if (sse.event === null) {
Expand All @@ -91,7 +89,6 @@ export class Stream<Item> implements AsyncIterable<Item> {
throw APIError
}
}
done = true;
} catch (e) {
if (e instanceof Error && e.name === "AbortError") return;
throw e;
Expand Down

0 comments on commit fc0a732

Please sign in to comment.