1.1.0 • Published 3 years ago
itheima-tools-lzh v1.1.0
安装
npm i itheima-tools-lzh
导入
const itheima = require('itheima-tools-lzh');
格式化时间
const newDate = itheima.dateFormat();
// 2021-07-20 13:17:12
转义html特殊字符
const newStr = itheima.htmlEscape('<h1>1&2"3</h1>');
// <h1>1&2"3</h1>
还原特殊字符
const newUnStr = itheima.htmlUnEscape('<h1>1&2"3</h1>');
// <h1>1&2"3</h1>
1.1.0
3 years ago