将 type-is 从 2.x 升级到 3.x
根据 TypeScript 类型自动比较 type-is 2.1.0 与 3.0.0 的公开 API。签名变化表示可能存在不兼容变更,并非确定结论。
概要
| 已删除的导入路径 | 0 |
|---|---|
| 已删除的导出 | 1 |
| 已修改的签名 | 3 |
| 已删除的类或接口成员 | 0 |
| 已修改的类或接口成员 | 0 |
| 新增弃用 | 0 |
| 要求变化(engines、peer 依赖) | 1 |
| 新增导出 | 7 |
已删除的导出
| import | export | kind | 之前 |
|---|---|---|---|
type-is | is | function | (mediaType: string, types: string[]): string | false | (mediaType: string, ...types: string[]): string | false |
已修改的签名
| export | 之前 | 之后 |
|---|---|---|
type-is · match | (expected: string | false, actual: string): boolean | (expected: string): (actual: string) => boolean |
type-is · hasBody | (request: IncomingMessage): boolean | (req: RequestLike): boolean |
type-is · normalize | (type: string): string | false | (value: string, options?: NormalizeOptions | undefined): string | string[] |
已删除的类或接口成员
未发现。
已修改的类或接口成员
未发现。
新增弃用
未发现。
要求变化(engines、peer 依赖)
| 之前 | 之后 | |
|---|---|---|
engines.node | >= 18 | >= 22 |
新增导出 (7)
| import | export | kind |
|---|---|---|
type-is | TypeIs | class |
type-is | RequestLike | interface |
type-is | TypeIsOptions | interface |
type-is | DEFAULT_LOOKUP | function |
type-is | ParameterValue | type |
type-is | NormalizeOptions | interface |
type-is | DEFAULT_PARAMETER_VALUE | function |
常见问题
将 type-is 从 2 升级到 3 有哪些不兼容变更?
在 type-is 2.1.0 与 3.0.0 之间,Vigia 发现 1 个已删除的导出、3 个已修改的签名,以及 0 个已删除或修改的类或接口成员。
type-is 3 中弃用了哪些内容?
type-is 3.0.0 中有 0 个导出或成员新被标记为弃用。
供智能体使用
GET https://vigia.coredls.cloud/v1/packages/npm/type-is/upgrade?from=2.1.0&to=3.0.0