File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff line change @@ -6383,9 +6383,9 @@ typedoc@^0.27.0:
63836383 yaml "^2.6.1"
63846384
63856385typescript@^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
63906390uc.micro@^2.0.0, uc.micro@^2.1.0 :
63916391 version "2.1.0"
You can’t perform that action at this time.
0 commit comments