Nâng cấp path-to-regexp từ 7.x lên 8.x
So sánh API công khai của path-to-regexp 7.2.0 và 8.4.2, được tính tự động từ kiểu TypeScript. Chữ ký thay đổi là thay đổi có thể không tương thích, không phải điều chắc chắn.
Tóm tắt
| Đường dẫn import bị xóa | 0 |
|---|---|
| Export bị xóa | 0 |
| Chữ ký thay đổi | 5 |
| Thành viên lớp hoặc interface bị xóa | 16 |
| Thành viên lớp hoặc interface thay đổi | 1 |
| Mới bị ngừng hỗ trợ | 0 |
| Thay đổi yêu cầu (engines, phụ thuộc peer) | 1 |
| Export mới | 7 |
Export bị xóa
Không phát hiện.
Chữ ký thay đổi
| export | Trước | Sau |
|---|---|---|
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; } |
Thành viên lớp hoặc interface bị xóa
| member | import | Trước |
|---|---|---|
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 |
Thành viên lớp hoặc interface thay đổi
| member | Trước | Sau |
|---|---|---|
TokenData.constructor | (tokens: Token[], delimiter: string): TokenData | (tokens: Token[], originalPath?: string | undefined): TokenData |
Mới bị ngừng hỗ trợ
Không phát hiện.
Thay đổi yêu cầu (engines, phụ thuộc peer)
| Trước | Sau | |
|---|---|---|
engines.node | >=16 | — |
Export mới (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 |
Câu hỏi thường gặp
Nâng cấp path-to-regexp từ 7 lên 8 có những thay đổi không tương thích nào?
Giữa path-to-regexp 7.2.0 và 8.4.2, Vigia tìm thấy 0 export bị xóa, 5 chữ ký thay đổi và 17 thành viên lớp hoặc interface bị xóa hay thay đổi.
Những gì bị ngừng hỗ trợ trong path-to-regexp 8?
0 export hoặc thành viên mới bị đánh dấu ngừng hỗ trợ trong path-to-regexp 8.4.2.
Dành cho tác tử
GET https://vigia.coredls.cloud/v1/packages/npm/path-to-regexp/upgrade?from=7.2.0&to=8.4.2