1.1.0 • Published 5 months ago
lsk-xss-safe v1.1.0
安装
npm install lsk-xss-safe
导入
const xssSafe = require('lsk-xss-safe')
格式化时间
const dtStr = xssSafe.dateFormat(new Date())
转义 HTML 中的特殊字符
const htmlStr = '<h1 title="abc">我是h1标签<span>123 </span></h1>'
const str = xssSafe.htmlEscape(htmlStr)
还原 HTML 中的特殊字符
const str2 = xssSafe.htmlUnEscape(str)
开源协议
ISC
1.1.0
5 months ago