1.0.0 • Published 12 months ago
itheima-tools-bag v1.0.0
安装
npm install itheima-tools
导入
const itheima = require('itheima-tools')
格式化时间
const daStr = itheima.dateFormat(new Date())
consloe.log(dtStr)
转义 HTML 中的特殊字符
const htmlStr = '<h1 title="abc">这是h1标签<span>1238nbsp;</span></h1>'
const str = itheima.htmlEscape(htmlStr)
//转化结果 <h1 title=undefinedabcundefined>这是h1标签<span>1238nbsp;</span></h1>
console.log(str)
开源协议
ISC
1.0.0
12 months ago