Skip to content

Commit c1c473e

Browse files
Update dependency typescript to v5.8.2 (#4736)
* Update dependency typescript to v5.8.2 * Improve types Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
1 parent 4835ca6 commit c1c473e

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/http-api/fetch.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ interface TypedResponse<T> extends Response {
3939
json(): Promise<T>;
4040
}
4141

42-
export type ResponseType<T, O extends IHttpOpts> = O extends undefined
43-
? T
44-
: O extends { onlyData: true }
42+
export type ResponseType<T, O extends IHttpOpts> = O extends { json: false }
43+
? string
44+
: O extends { onlyData: true } | undefined
4545
? T
4646
: TypedResponse<T>;
4747

@@ -371,7 +371,7 @@ export class FetchHttpApi<O extends IHttpOpts> {
371371
}
372372

373373
if (this.opts.onlyData) {
374-
return json ? res.json() : res.text();
374+
return (json ? res.json() : res.text()) as ResponseType<T, O>;
375375
}
376376
return res as ResponseType<T, O>;
377377
}

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6383,9 +6383,9 @@ typedoc@^0.27.0:
63836383
yaml "^2.6.1"
63846384

63856385
typescript@^5.4.2:
6386-
version "5.7.3"
6387-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.7.3.tgz#919b44a7dbb8583a9b856d162be24a54bf80073e"
6388-
integrity sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==
6386+
version "5.8.2"
6387+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.8.2.tgz#8170b3702f74b79db2e5a96207c15e65807999e4"
6388+
integrity sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==
63896389

63906390
uc.micro@^2.0.0, uc.micro@^2.1.0:
63916391
version "2.1.0"

0 commit comments

Comments
 (0)