mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-12-02 06:49:47 -06:00
Better type solution
This commit is contained in:
@@ -49,8 +49,13 @@ export class StorageRemote extends StorageBase {
|
||||
baseUrl: this.baseUrl,
|
||||
});
|
||||
|
||||
this.get = promisify(req.get as any as (uri: string, options?: request.CoreOptions) => request.Response);
|
||||
this.post = promisify(req.post as any as (uri: string, options?: request.CoreOptions) => request.Response);
|
||||
// Workaround for ts type shenanigans with defaulting to the last overload
|
||||
this.get = promisify((uri: string, options?: request.CoreOptions, callback?: request.RequestCallback) =>
|
||||
req.get(uri, options, callback),
|
||||
);
|
||||
this.post = promisify((uri: string, options?: request.CoreOptions, callback?: request.RequestCallback) =>
|
||||
req.post(uri, options, callback),
|
||||
);
|
||||
}
|
||||
|
||||
override async handler(req: express.Request, res: express.Response) {
|
||||
|
||||
Reference in New Issue
Block a user