From d0ed29f8a20a386bc82b075efda68e549efb316c Mon Sep 17 00:00:00 2001 From: use-strict Date: Tue, 14 Mar 2017 15:03:47 +0200 Subject: [PATCH 1/2] http-errors: Add missing constructor Allows the following to work: ```typescript import { HttpError } from "http-errors"; let error: HttpError; console.log(error instanceof HttpError); ``` --- http-errors/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/http-errors/index.d.ts b/http-errors/index.d.ts index 176703f23f..aff5b312dd 100644 --- a/http-errors/index.d.ts +++ b/http-errors/index.d.ts @@ -23,6 +23,8 @@ declare module 'http-errors' { [code: string]: new (msg?: string) => HttpError; (...args: Array): HttpError; + + HttpError: HttpErrorConstructor; Continue: HttpErrorConstructor; SwitchingProtocols: HttpErrorConstructor; From 5141daceb0a11f126a035ccc6e7044530bb2c3c1 Mon Sep 17 00:00:00 2001 From: use-strict Date: Tue, 14 Mar 2017 17:15:43 +0200 Subject: [PATCH 2/2] Update http-errors-tests.ts --- http-errors/http-errors-tests.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/http-errors/http-errors-tests.ts b/http-errors/http-errors-tests.ts index e8c12126b4..51017828a1 100644 --- a/http-errors/http-errors-tests.ts +++ b/http-errors/http-errors-tests.ts @@ -83,3 +83,4 @@ var err = new createError.MisdirectedRequest(); var err = new createError.MisdirectedRequest('Where should this go?'); let error: createError.HttpError; +console.log(error instanceof createError.HttpError);