Vigia

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óa0
Export bị xóa0
Chữ ký thay đổi5
Thành viên lớp hoặc interface bị xóa16
Thành viên lớp hoặc interface thay đổi1
Mới bị ngừng hỗ trợ0
Thay đổi yêu cầu (engines, phụ thuộc peer)1
Export mới7

Export bị xóa

Không phát hiện.

Chữ ký thay đổi

exportTrướcSau
path-to-regexp · KeyinterfaceParameter | Wildcard
path-to-regexp · Tokenstring | KeyText | 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

memberimportTrước
TokenData.delimiterpath-to-regexpstring
MatchResult.indexpath-to-regexpnumber
MatchOptions.loosepath-to-regexpboolean | undefined
MatchOptions.startpath-to-regexpboolean | undefined
MatchOptions.strictpath-to-regexpboolean | undefined
MatchOptions.encodePathpath-to-regexpEncode | undefined
ParseOptions.delimiterpath-to-regexpstring | undefined
CompileOptions.loosepath-to-regexpboolean | undefined
CompileOptions.strictpath-to-regexpboolean | undefined
CompileOptions.validatepath-to-regexpboolean | undefined
CompileOptions.sensitivepath-to-regexpboolean | undefined
CompileOptions.encodePathpath-to-regexpEncode | undefined
PathToRegexpOptions.loosepath-to-regexpboolean | undefined
PathToRegexpOptions.startpath-to-regexpboolean | undefined
PathToRegexpOptions.strictpath-to-regexpboolean | undefined
PathToRegexpOptions.encodePathpath-to-regexpEncode | undefined

Thành viên lớp hoặc interface thay đổi

memberTrướcSau
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ướcSau
engines.node>=16—
Export mới (7)
importexportkind
path-to-regexpKeystype
path-to-regexpTextinterface
path-to-regexpGroupinterface
path-to-regexpWildcardinterface
path-to-regexpParameterinterface
path-to-regexpPathErrorclass
path-to-regexpstringifyfunction

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