You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I create a got instance with resolveBodyOnly set to true, the type checker still things that the body is wrapped in a response.
Actual behavior
void(async()=>{constjsonBodyClient=got.extend({responseType: 'json',resolveBodyOnly: true,});interfaceResType{
foo: string;
bar: string;}consttest=awaitjsonBodyClient<ResType>('issue/details');test.foo;// => TS2339: Property 'foo' does not exist on type 'Response '.})();
Expected behavior
void(async()=>{constjsonBodyClient=got.extend({responseType: 'json',resolveBodyOnly: true,});interfaceResType{
foo: string;
bar: string;}consttest=awaitjsonBodyClient<ResType>('issue/details');test.foo;// should not throw typescript error})();
Code to reproduce
void(async()=>{constjsonBodyClient=got.extend({responseType: 'json',resolveBodyOnly: true,});interfaceResType{
foo: string;
bar: string;}consttest=awaitjsonBodyClient<ResType>('issue/details');test.foo;// => TS2339: Property 'foo' does not exist on type 'Response '.})();
Checklist
I have read the documentation.
I have tried my code with the latest version of Node.js and Got.
The text was updated successfully, but these errors were encountered:
Describe the bug
When I create a
got
instance withresolveBodyOnly
set totrue
, the type checker still things that the body is wrapped in a response.Actual behavior
Expected behavior
Code to reproduce
Checklist
The text was updated successfully, but these errors were encountered: