From 8e05f3e50503d0deaf4effd9e091dbb746188a27 Mon Sep 17 00:00:00 2001 From: axetroy Date: Mon, 15 Apr 2019 01:43:20 +0800 Subject: [PATCH 1/2] fix ts warnning --- http/server_test.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/http/server_test.ts b/http/server_test.ts index 09a8df2bd187..89244ed2aa32 100644 --- a/http/server_test.ts +++ b/http/server_test.ts @@ -19,14 +19,17 @@ interface ResponseTest { const enc = new TextEncoder(); const dec = new TextDecoder(); +type handler = () => void; + interface Deferred { promise: Promise<{}>; - resolve: () => void; - reject: () => void; + resolve: handler; + reject: handler; } function deferred(isResolved = false): Deferred { - let resolve, reject; + let resolve: handler = () => void 0; + let reject: handler = () => void 0; const promise = new Promise((res, rej) => { resolve = res; reject = rej; From 95ffdde9e5d730b68483a26c9bbd60cae7843fcd Mon Sep 17 00:00:00 2001 From: axetroy Date: Mon, 15 Apr 2019 09:42:54 +0800 Subject: [PATCH 2/2] handler type capitalized --- http/server_test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/http/server_test.ts b/http/server_test.ts index 89244ed2aa32..ed28025cdeb0 100644 --- a/http/server_test.ts +++ b/http/server_test.ts @@ -19,17 +19,17 @@ interface ResponseTest { const enc = new TextEncoder(); const dec = new TextDecoder(); -type handler = () => void; +type Handler = () => void; interface Deferred { promise: Promise<{}>; - resolve: handler; - reject: handler; + resolve: Handler; + reject: Handler; } function deferred(isResolved = false): Deferred { - let resolve: handler = () => void 0; - let reject: handler = () => void 0; + let resolve: Handler = () => void 0; + let reject: Handler = () => void 0; const promise = new Promise((res, rej) => { resolve = res; reject = rej;