0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 09:31:22 -05:00

fix(cli/dts): Make respondWith() return a Promise (#10128)

This commit is contained in:
Nayeem Rahman 2021-04-13 12:41:47 +01:00 committed by GitHub
parent a8057e3e06
commit df49a8462c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -1158,7 +1158,7 @@ declare namespace Deno {
export interface RequestEvent {
readonly request: Request;
respondWith(r: Response | Promise<Response>): void;
respondWith(r: Response | Promise<Response>): Promise<void>;
}
export interface HttpConn extends AsyncIterable<RequestEvent> {

View file

@ -106,8 +106,8 @@
return array;
}
function createRespondWith(responseSenderRid, connRid) {
return async function (resp) {
function createRespondWith(responseSenderRid) {
return async function respondWith(resp) {
if (resp instanceof Promise) {
resp = await resp;
}