1.0.5 • Published 2 years ago
sunfirstday v1.0.5
安装
npm install sunfirstday
时间格式化
//2022-04-01 15:21:50
const date = sun.moment(new Date())
html 字符串转义
//转义前html字符
const htmlStr = '<div><span>sun htmlEscape</span></div>'
//<div><span>sun htmlEscape</span></div>
const escapeAfter = sunfirstday.htmlEscape(htmlStr)
html 转义字符还原
const escapeBefore = sunfirstday.htmlUnEscape(escapeAfter)
//<div><span>sun htmlEscape  </span></div>
console.log(escapeBefore)