1.0.6 • Published 2 years ago
@whsanxiandoupi/itheima-tools-harbinppp v1.0.6
安装
npm ianstall itheima-tools
导入
const itheima =require('itheima-tools)
格式化时间
const dtStr = itheima.dateFormat(new Date());
console.log(dtStr);
转义 HTMl 中的特殊字符
const htmlStr = '<h1 title="zsh">h1标签<span>123 </span></h1>';
const str = itheima.htmlEscape(htmlStr);
console.log(str);
还原 HTML 字符串
const str2 = itheima.htmlUnEscape(str);
console.log(str2);
开源协议
TSC