removed 6 underscore requires

This commit is contained in:
Peter Cottle 2015-04-20 16:19:15 +10:00
parent b5cf7f9343
commit 93d9ac693f
11 changed files with 48 additions and 31 deletions

View file

@ -0,0 +1,14 @@
var mapping = {
'&': '&',
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
"'": '&#x27;',
'/': '&#x2F;'
};
module.exports = function(string) {
return ('' + string).replace(/[&<>"'\/]/g, function(match) {
return mapping[match];
});
};