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:
parent
a8057e3e06
commit
df49a8462c
2 changed files with 3 additions and 3 deletions
2
cli/dts/lib.deno.unstable.d.ts
vendored
2
cli/dts/lib.deno.unstable.d.ts
vendored
|
@ -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> {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue