1.0.0 • Published 2 years ago
itheima-ldh v1.0.0
安装
npm i itheima-ldh
导入
const custom = require('./itheima-ldh')
格式化时间
const dtStr = custom.dateFormat(new Date())
console.log(dtStr);
转义HTML中的特殊字符
const htmlStr = custom.htmlEscape('<h1 title="abc">这是H1标签<span>123 </span></h1>')
console.log(htmlStr);
还原HTML中的特殊字符
const htmlLable = custom.htmlRestore(htmlStr)
console.log(htmlLable);
开源协议
ISC
1.0.0
2 years ago