将 http-errors 从 1.x 升级到 2.x
根据 TypeScript 类型自动比较 http-errors 1.8.1 与 2.0.1 的公开 API。签名变化表示可能存在不兼容变更,并非确定结论。
概要
| 已删除的导入路径 | 0 |
|---|---|
| 已删除的导出 | 0 |
| 已修改的签名 | 4 |
| 已删除的类或接口成员 | 0 |
| 已修改的类或接口成员 | 0 |
| 新增弃用 | 0 |
| 要求变化(engines、peer 依赖) | 1 |
| 新增导出 | 0 |
已删除的导出
未发现。
已修改的签名
| export | 之前 | 之后 |
|---|---|---|
http-errors · UnknownError | string | number | Error | { [key: string]: any; } | string | Error | { [key: string]: any; } |
http-errors · CreateHttpError | <N extends UnknownError>(arg: N, ...rest: UnknownError[]) => HttpError<N extends number ? N : number> | interface |
http-errors · NamedConstructors | { [code: string]: HttpErrorConstructor<number>; HttpError: HttpErrorConstructor<number>; } & Record<"BadRequest" | "400", HttpErrorConstructor<400>> & Record<"Unauthorized" | "401", HttpErrorConstructor<401>> & Record<"PaymentRequired" | "402", HttpErrorConstructor<402>> & Record<"Forbidden" | "403", HttpErrorConstructor<403>> & Record<"NotFound" | "404", HttpErrorConstructor<404>> & Record<"MethodNotAllowed" | "405", HttpErrorConstructor<405>> & Record<"NotAcceptable" | "406", HttpErrorConstructor<406>> & Record<"ProxyAuthenticationRequired" | "407", HttpErrorConstructor<407>> & Record<"Reque… | { HttpError: HttpErrorConstructor<number>; } & Record<"BadRequest" | "400", HttpErrorConstructor<400>> & Record<"Unauthorized" | "401", HttpErrorConstructor<401>> & Record<"PaymentRequired" | "402", HttpErrorConstructor<402>> & Record<"Forbidden" | "403", HttpErrorConstructor<403>> & Record<"NotFound" | "404", HttpErrorConstructor<404>> & Record<"MethodNotAllowed" | "405", HttpErrorConstructor<405>> & Record<"NotAcceptable" | "406", HttpErrorConstructor<406>> & Record<"ProxyAuthenticationRequired" | "407", HttpErrorConstructor<407>> & Record<"RequestTimeout" | "408", HttpErrorConstructor<408>>… |
http-errors · HttpErrorConstructor | new (msg?: string | undefined) => HttpError<N> | interface |
已删除的类或接口成员
未发现。
已修改的类或接口成员
未发现。
新增弃用
未发现。
要求变化(engines、peer 依赖)
| 之前 | 之后 | |
|---|---|---|
engines.node | >= 0.6 | >= 0.8 |
常见问题
将 http-errors 从 1 升级到 2 有哪些不兼容变更?
在 http-errors 1.8.1 与 2.0.1 之间,Vigia 发现 0 个已删除的导出、4 个已修改的签名,以及 0 个已删除或修改的类或接口成员。
http-errors 2 中弃用了哪些内容?
http-errors 2.0.1 中有 0 个导出或成员新被标记为弃用。
供智能体使用
GET https://vigia.coredls.cloud/v1/packages/npm/http-errors/upgrade?from=1.8.1&to=2.0.1