mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-20 06:12:54 +08:00
Merge pull request #15164 from use-strict/patch-3
http-errors: Add missing constructor
This commit is contained in:
@@ -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);
|
||||
|
||||
2
http-errors/index.d.ts
vendored
2
http-errors/index.d.ts
vendored
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user