Merge pull request #15164 from use-strict/patch-3

http-errors: Add missing constructor
This commit is contained in:
Yui
2017-03-14 21:07:24 -07:00
committed by GitHub
2 changed files with 3 additions and 0 deletions

View File

@@ -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);

View File

@@ -23,6 +23,8 @@ declare module 'http-errors' {
[code: string]: new (msg?: string) => HttpError;
(...args: Array<Error | string | number | Object>): HttpError;
HttpError: HttpErrorConstructor;
Continue: HttpErrorConstructor;
SwitchingProtocols: HttpErrorConstructor;