1.0.0 • Published 1 year ago
testpackage-tools1 v1.0.0
安装
npm install testpackage-tools1
导入
let formateTime = require("./dataformate");
格式化时间
const dtr = formateTime.dateFormat(new Date());
转义 HTML 中的特殊字符
// 转移
var unsafe = '<script>alert("XSS!");</script>';
var safe = formateTime.escapeHtml(unsafe);
反转义 HTML 中的特殊字符
//反转义
const encoded = "<script>alert("Not XSS!");</script>";
var unEscapeHtml = formateTime.unescapeHtml(encoded);
开源协议
ISC
1.0.0
1 year ago