将 path-to-regexp 从 7.x 升级到 8.x
根据 TypeScript 类型自动比较 path-to-regexp 7.2.0 与 8.4.2 的公开 API。签名变化表示可能存在不兼容变更,并非确定结论。
概要
| 已删除的导入路径 | 0 |
|---|---|
| 已删除的导出 | 0 |
| 已修改的签名 | 5 |
| 已删除的类或接口成员 | 16 |
| 已修改的类或接口成员 | 1 |
| 新增弃用 | 0 |
| 要求变化(engines、peer 依赖) | 1 |
| 新增导出 | 7 |
已删除的导出
未发现。
已修改的签名
| export | 之前 | 之后 |
|---|---|---|
path-to-regexp · Key | interface | Parameter | Wildcard |
path-to-regexp · Token | string | Key | Text | Parameter | Wildcard | Group |
path-to-regexp · match | <P extends ParamData>(path: Path | Path[], options?: MatchOptions | undefined): MatchFunction<P> | <P extends ParamData>(path: Path | Path[], options?: (MatchOptions & ParseOptions) | undefined): MatchFunction<P> |
path-to-regexp · compile | <P extends ParamData = Partial<Record<string, string | string[]>>>(path: Path, options?: CompileOptions | undefined): PathFunction<P> | <P extends ParamData = Partial<Record<string, string | string[]>>>(path: Path, options?: (CompileOptions & ParseOptions) | undefined): (params?: P | undefined) => string |
path-to-regexp · pathToRegexp | (path: Path | Path[], options?: PathToRegexpOptions | undefined): RegExp & { keys: Key[]; } | (path: Path | Path[], options?: (PathToRegexpOptions & ParseOptions) | undefined): { regexp: RegExp; keys: Keys; } |
已删除的类或接口成员
| member | import | 之前 |
|---|---|---|
TokenData.delimiter | path-to-regexp | string |
MatchResult.index | path-to-regexp | number |
MatchOptions.loose | path-to-regexp | boolean | undefined |
MatchOptions.start | path-to-regexp | boolean | undefined |
MatchOptions.strict | path-to-regexp | boolean | undefined |
MatchOptions.encodePath | path-to-regexp | Encode | undefined |
ParseOptions.delimiter | path-to-regexp | string | undefined |
CompileOptions.loose | path-to-regexp | boolean | undefined |
CompileOptions.strict | path-to-regexp | boolean | undefined |
CompileOptions.validate | path-to-regexp | boolean | undefined |
CompileOptions.sensitive | path-to-regexp | boolean | undefined |
CompileOptions.encodePath | path-to-regexp | Encode | undefined |
PathToRegexpOptions.loose | path-to-regexp | boolean | undefined |
PathToRegexpOptions.start | path-to-regexp | boolean | undefined |
PathToRegexpOptions.strict | path-to-regexp | boolean | undefined |
PathToRegexpOptions.encodePath | path-to-regexp | Encode | undefined |
已修改的类或接口成员
| member | 之前 | 之后 |
|---|---|---|
TokenData.constructor | (tokens: Token[], delimiter: string): TokenData | (tokens: Token[], originalPath?: string | undefined): TokenData |
新增弃用
未发现。
要求变化(engines、peer 依赖)
| 之前 | 之后 | |
|---|---|---|
engines.node | >=16 | — |
新增导出 (7)
| import | export | kind |
|---|---|---|
path-to-regexp | Keys | type |
path-to-regexp | Text | interface |
path-to-regexp | Group | interface |
path-to-regexp | Wildcard | interface |
path-to-regexp | Parameter | interface |
path-to-regexp | PathError | class |
path-to-regexp | stringify | function |
常见问题
将 path-to-regexp 从 7 升级到 8 有哪些不兼容变更?
在 path-to-regexp 7.2.0 与 8.4.2 之间,Vigia 发现 0 个已删除的导出、5 个已修改的签名,以及 17 个已删除或修改的类或接口成员。
path-to-regexp 8 中弃用了哪些内容?
path-to-regexp 8.4.2 中有 0 个导出或成员新被标记为弃用。
供智能体使用
GET https://vigia.coredls.cloud/v1/packages/npm/path-to-regexp/upgrade?from=7.2.0&to=8.4.2