File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,10 @@ export class ApiClient {
37
37
} ;
38
38
} ;
39
39
40
+ // createFetch assumes that the first parameter of fetch is always a string
41
+ // with the URL. However, fetch can also receive a Request object. While
42
+ // the typechecking complains, createFetch does passthrough the parameters
43
+ // so it works fine.
40
44
private static customFetch : typeof fetch = createFetch ( {
41
45
useEnvironmentVariableProxies : true ,
42
46
} ) as unknown as typeof fetch ;
@@ -104,6 +108,9 @@ export class ApiClient {
104
108
Accept : `application/vnd.atlas.${ ATLAS_API_VERSION } +json` ,
105
109
} ,
106
110
fetch : ApiClient . customFetch ,
111
+ // NodeFetchRequest has more overloadings than the native Request
112
+ // so it complains here. However, the interfaces are actually compatible
113
+ // so it's not a real problem, just a type checking problem.
107
114
Request : NodeFetchRequest as unknown as ClientOptions [ "Request" ] ,
108
115
} ) ;
109
116
You can’t perform that action at this time.
0 commit comments