yiquan0816-tools
Version:
提供了格式化时间、HTMLEscape相关功能
16 lines (14 loc) • 465 B
JavaScript
const itheima = require('./index')
console.log(itheima);
// 格式化时间的功能
const dtStr = itheima.deteFormat(new Date())
console.log(dtStr)
console.log('-----------')
// 转换的 HTML 字符串
const htmlStr = '<h1 title="abc">这是h1标签<span>123 </span></h1>'
const str = itheima.htmlEscape(htmlStr)
console.log(str)
console.log('-----------')
// 还原的 HTML 字符串
const str2 = itheima.htmlUnEscape(str)
console.log(str2)