UNPKG

xi-2022

Version:

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

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