xxm-test-js
Version:
xxm-js通用js工具(utils)库
11 lines (10 loc) • 374 B
TypeScript
/**
* 将字符串进行 HTML 转义
* @param {string | null | undefined} str - 要转义的字符串,可为 null 或 undefined
* @returns {string} 转义后的字符串
* @example
* ```js
* htmlEscape('Hello & World < Example >') // 返回 'Hello & World < Example >'
* ```
*/
export declare function htmlEscape(str: string | null | undefined): string;