1.0.0 • Published 2 years ago

pete-five v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

安装

npm install pete-five

导入

const pete = require('pete-five')

html标签转义

let htmlStr = '<h1 style="color: pink;">还就忘了吧,在那些和你错开的时间里,以为能忘了你&map<span></span></h1>'
let result1 = pete.htmlEscape(htmlStr)
console.log(result1);
// &lt;h1 style=&quot;color: pink;&quot;&gt;还就忘了吧,在那些和你错开的时间里,以为能忘了你&amp;map&lt;span&gt;&lt;/span&gt;&lt;/h1&gt;

html转义还原

let result2 = pete.htmlUnEscape(result1)
console.log(result2);
// <h1 style="color: pink;">还就忘了吧,在那些和你错开的时间里,以为能忘了你&map<span></span></h1>

test-split

let str = '1,2,3,4,5'
let result3 = pete.testSplit(str, ',')
console.log(result3);

开源协议

ISC
1.0.0

2 years ago