mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -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 {
|
export interface RequestEvent {
|
||||||
readonly request: Request;
|
readonly request: Request;
|
||||||
respondWith(r: Response | Promise<Response>): void;
|
respondWith(r: Response | Promise<Response>): Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface HttpConn extends AsyncIterable<RequestEvent> {
|
export interface HttpConn extends AsyncIterable<RequestEvent> {
|
||||||
|
|
|
@ -106,8 +106,8 @@
|
||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
function createRespondWith(responseSenderRid, connRid) {
|
function createRespondWith(responseSenderRid) {
|
||||||
return async function (resp) {
|
return async function respondWith(resp) {
|
||||||
if (resp instanceof Promise) {
|
if (resp instanceof Promise) {
|
||||||
resp = await resp;
|
resp = await resp;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue