mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-08-29 06:18:24 +02:00
14 lines
251 B
JavaScript
14 lines
251 B
JavaScript
var mapping = {
|
|
'&': '&',
|
|
'<': '<',
|
|
'>': '>',
|
|
'"': '"',
|
|
"'": ''',
|
|
'/': '/'
|
|
};
|
|
|
|
module.exports = function(string) {
|
|
return ('' + string).replace(/[&<>"'\/]/g, function(match) {
|
|
return mapping[match];
|
|
});
|
|
};
|