将 entities 从 7.x 升级到 8.x
根据 TypeScript 类型自动比较 entities 7.0.1 与 8.1.0 的公开 API。签名变化表示可能存在不兼容变更,并非确定结论。
概要
| 已删除的导入路径 | 0 |
|---|---|
| 已删除的导出 | 9 |
| 已修改的签名 | 7 |
| 已删除的类或接口成员 | 0 |
| 已修改的类或接口成员 | 0 |
| 新增弃用 | 1 |
| 要求变化(engines、peer 依赖) | 1 |
| 新增导出 | 2 |
已删除的导出
| import | export | kind | 之前 |
|---|---|---|---|
entities | decodeHTML4 | function | (htmlString: string, mode?: DecodingMode | undefined): string |
entities | decodeHTML5 | function | (htmlString: string, mode?: DecodingMode | undefined): string |
entities | encodeHTML4 | function | (input: string): string |
entities | encodeHTML5 | function | (input: string): string |
entities | decodeStrict | function | (input: string, options?: DecodingOptions | EntityLevel | undefined): string |
entities | decodeHTML4Strict | function | (htmlString: string): string |
entities | decodeHTML5Strict | function | (htmlString: string): string |
entities/decode | fromCodePoint | variable | (...codePoints: number[]): string |
entities/decode | decodeCodePoint | function | (codePoint: number): string |
已修改的签名
| export | 之前 | 之后 |
|---|---|---|
entities · escapeText | (data: string): string | (data: string): string |
entities · escapeUTF8 | (data: string): string | (data: string): string |
entities · escapeAttribute | (data: string): string | (data: string): string |
entities/escape · escapeText | (data: string): string | (data: string): string |
entities/escape · escapeUTF8 | (data: string): string | (data: string): string |
entities/escape · getCodePoint | (c: string, index: number): number | (input: string, index: number): number |
entities/escape · escapeAttribute | (data: string): string | (data: string): string |
已删除的类或接口成员
未发现。
已修改的类或接口成员
未发现。
新增弃用
| export | @deprecated |
|---|---|
entities/escape · getCodePoint | Use `String.prototype.codePointAt` directly instead; this export will be removed in the next major. |
要求变化(engines、peer 依赖)
| 之前 | 之后 | |
|---|---|---|
engines.node | >=0.12 | >=20.19.0 |
新增导出 (2)
| import | export | kind |
|---|---|---|
entities/decode | replaceCodePointXML | function |
entities/escape | xmlEncodeRegex | variable |
常见问题
将 entities 从 7 升级到 8 有哪些不兼容变更?
在 entities 7.0.1 与 8.1.0 之间,Vigia 发现 9 个已删除的导出、7 个已修改的签名,以及 0 个已删除或修改的类或接口成员。
entities 8 中弃用了哪些内容?
entities 8.1.0 中有 1 个导出或成员新被标记为弃用。
供智能体使用
GET https://vigia.coredls.cloud/v1/packages/npm/entities/upgrade?from=7.0.1&to=8.1.0