-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
35 lines (32 loc) · 860 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/**
* Building a collection of distributed performance helpers in js.
*
* @param {String} html
* @return {String}
*/
var music = require('./lib/modules/music')
// var hub = require('./lib/hub/hub')
module.exports = {
escape: function(html) {
return String(html)
.replace(/&/g, '&')
.replace(/"/g, '"')
.replace(/'/g, ''')
.replace(/</g, '<')
.replace(/>/g, '>');
},
/**
* Unescape special characters in the given string of html.
*
* @param {String} html
* @return {String}
*/
unescape: function(html) {
return String(html)
.replace(/&/g, '&')
.replace(/"/g, '"')
.replace(/'/g, '')
.replace(/</g, '<')
.replace(/>/g, '>');
}
};