UNPKG

ut2

Version:

一个现代 JavaScript 实用工具库。[点击查看在线文档]。

18 lines (17 loc) 589 B
/** * 转义字符串中的 HTML 实体字符 `&amp;` `&lt;` `&quot;` `&#39;` 为对应的字符。 * * 注意:不会转换其他的 HTML 实体。如果需要,可以使用第三方库,如 [he](https://github.com/mathiasbynens/he) 。 * * @alias module:String.unescape * @since 1.0.0 * @param {string} string 要转换的字符串。 * @returns {string} 转换后的字符串。 * @example * * unescape('&lt;script&gt;&lt;/script&gt;'); // '<script></script>' * * unescape('&amp;'); // '&' */ declare function unescape(string: string): string; export default unescape;