mirror of
https://github.com/denoland/deno.git
synced 2024-12-25 00:29:09 -05:00
fix ts warning for http/server_test.ts (denoland/deno_std#342)
Original: f7ff14b6fd
This commit is contained in:
parent
7336800658
commit
b062300270
1 changed files with 6 additions and 3 deletions
|
@ -19,14 +19,17 @@ interface ResponseTest {
|
||||||
const enc = new TextEncoder();
|
const enc = new TextEncoder();
|
||||||
const dec = new TextDecoder();
|
const dec = new TextDecoder();
|
||||||
|
|
||||||
|
type Handler = () => void;
|
||||||
|
|
||||||
interface Deferred {
|
interface Deferred {
|
||||||
promise: Promise<{}>;
|
promise: Promise<{}>;
|
||||||
resolve: () => void;
|
resolve: Handler;
|
||||||
reject: () => void;
|
reject: Handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
function deferred(isResolved = false): Deferred {
|
function deferred(isResolved = false): Deferred {
|
||||||
let resolve, reject;
|
let resolve: Handler = () => void 0;
|
||||||
|
let reject: Handler = () => void 0;
|
||||||
const promise = new Promise((res, rej) => {
|
const promise = new Promise((res, rej) => {
|
||||||
resolve = res;
|
resolve = res;
|
||||||
reject = rej;
|
reject = rej;
|
||||||
|
|
Loading…
Reference in a new issue