itheima-1982

1.0.0 • Public • Published

安装

npm install itheima-tools-1982

格式化时间

//调用 dateFormat 对时间进行格式化

onst dtStr = itheima.dateFormat(new Date())
console.log(dtStr);

## 转义HTML 中的特殊字符
```js

const htmlStr = '<h1 title="abc">这是h1标签<span>123&nbsp;</span></h1>'
const str1 =  itheima.htmlEscape(htmlStr)
console.log(str1);

还原 HTML中的特殊字符

//待还原的HTML字符串
const str2 = itheima.htmlUnEscape(str1);
console.log(str2);

Package Sidebar

Install

npm i itheima-1982

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

731 kB

Total Files

35

Last publish

Collaborators

  • zjt1982