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 {
3737 } ;
3838 } ;
3939
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.
4044 private static customFetch : typeof fetch = createFetch ( {
4145 useEnvironmentVariableProxies : true ,
4246 } ) as unknown as typeof fetch ;
@@ -104,6 +108,9 @@ export class ApiClient {
104108 Accept : `application/vnd.atlas.${ ATLAS_API_VERSION } +json` ,
105109 } ,
106110 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.
107114 Request : NodeFetchRequest as unknown as ClientOptions [ "Request" ] ,
108115 } ) ;
109116
You can’t perform that action at this time.
0 commit comments