1.0.0 • Published 2 years ago
itheima-tools-yx v1.0.0
安装
npm install itheima-tools
导入
const itheima = require("itheima-tools");
格式化时间
// 这是调用 dateFormat 对时间进行格式化处理
const dt = itheima.dateFormat(new Date());
// 结果 2022-07-03 15:14:18
转义 HTML 中的特殊字符
// 调用htmlEscape 方法 对字符串进行转移
const str = itheima.htmlEscape(htmlStr);
还原 HTML 中的特殊字符
const str1 = itheima.htmlUnEscape(str);
开源协议
ISC
1.0.0
2 years ago