@types/http-errors
Advanced tools
Comparing version 1.8.2 to 2.0.0
@@ -1,2 +0,2 @@ | ||
// Type definitions for http-errors 1.8 | ||
// Type definitions for http-errors 2.0 | ||
// Project: https://github.com/jshttp/http-errors | ||
@@ -6,3 +6,2 @@ // Definitions by: Tanguy Krotoff <https://github.com/tkrotoff> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.3 | ||
@@ -26,7 +25,13 @@ export = createHttpError; | ||
type UnknownError = Error | string | number | { [key: string]: any }; | ||
type UnknownError = Error | string | { [key: string]: any }; | ||
type HttpErrorConstructor<N extends number = number> = new (msg?: string) => HttpError<N>; | ||
interface HttpErrorConstructor<N extends number = number> { | ||
(msg?: string): HttpError<N>; | ||
new (msg?: string): HttpError<N>; | ||
} | ||
type CreateHttpError = <N extends UnknownError>(arg: N, ...rest: UnknownError[]) => HttpError<N extends number ? N : number>; | ||
interface CreateHttpError { | ||
<N extends number = number>(arg: N, ...rest: UnknownError[]): HttpError<N>; | ||
(...rest: UnknownError[]): HttpError; | ||
} | ||
@@ -36,3 +41,2 @@ type IsHttpError = (error: unknown) => error is HttpError; | ||
type NamedConstructors = { | ||
[code: string]: HttpErrorConstructor; | ||
HttpError: HttpErrorConstructor; | ||
@@ -63,3 +67,3 @@ } | ||
& Record<'FailedDependency' | '424', HttpErrorConstructor<424>> | ||
& Record<'UnorderedCollection' | '425', HttpErrorConstructor<425>> | ||
& Record<'TooEarly' | '425', HttpErrorConstructor<425>> | ||
& Record<'UpgradeRequired' | '426', HttpErrorConstructor<426>> | ||
@@ -66,0 +70,0 @@ & Record<'PreconditionRequired' | '428', HttpErrorConstructor<428>> |
{ | ||
"name": "@types/http-errors", | ||
"version": "1.8.2", | ||
"version": "2.0.0", | ||
"description": "TypeScript definitions for http-errors", | ||
@@ -28,4 +28,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/http-errors", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "c2479b8b9d3c81b8d5e05a4e9af2847027b1274dadcdd92a5468f98c98449978", | ||
"typeScriptVersion": "3.8" | ||
"typesPublisherContentHash": "2a471cba5e01f865223de296b7656093776797c20354f1d13c0d6ee5f98b31a4", | ||
"typeScriptVersion": "4.1" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Thu, 13 Jan 2022 20:01:39 GMT | ||
* Last updated: Thu, 27 Oct 2022 05:32:46 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: none |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
75