@minionorg/share
Version:
12 lines (11 loc) • 366 B
TypeScript
/**
* 转义html,防止xss攻击
*
* @param {string} str 目标字符串
* @return {string} 转义后的字符串
* @example
* const str = '<a href="#">hello & world & \'</a>';
* escapeHTML(str) = '<a href="#">hello & world & '</a>'
*/
declare function escapeHTML(str: string): string;
export default escapeHTML;