Skip to content

Commit

Permalink
vercel#369 Rename a type
Browse files Browse the repository at this point in the history
  • Loading branch information
alisabzevari committed Feb 9, 2019
1 parent 095e01f commit 95cae4c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/micro.ts
Expand Up @@ -6,12 +6,12 @@ import { readable } from "is-stream";
import { Body, HttpResponse } from "./http-message";
import { HttpError } from "./error";

export type HttpHanderResult = HttpResponse | Body | void | ServerResponse;
export type RequestHanderResult = HttpResponse | Body | void | ServerResponse;

export type RequestHandler = (
req: IncomingMessage,
res: ServerResponse
) => Promise<HttpHanderResult> | HttpHanderResult;
) => Promise<RequestHanderResult> | RequestHanderResult;

const { NODE_ENV } = process.env;
export const DEV = NODE_ENV === "development";
Expand Down Expand Up @@ -91,7 +91,7 @@ export const run = (
res: ServerResponse,
fn: RequestHandler
) =>
new Promise<HttpHanderResult>(resolve => resolve(fn(req, res)))
new Promise<RequestHanderResult>(resolve => resolve(fn(req, res)))
.then(val => {
if (val === null) {
send(res, 204, null);
Expand Down

0 comments on commit 95cae4c

Please sign in to comment.