UNPKG

xi-2022

Version:

提供了格式化时间、HTMLEscape相关的功能

20 lines (19 loc) 502 B
// 转义 function zy(html){ if(typeof html==='string'){ return html.replace(/<|>|&|"/g,m=>{ switch(m){ case '<': return '&lt;' case '>': return '&gt;' case '&': return '&amp;' case '"': return '&quot;' } })}else{ return '请输入字符串'}} module.exports={ zy }