mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-08-29 14:28:37 +02:00
removed 6 underscore requires
This commit is contained in:
parent
b5cf7f9343
commit
93d9ac693f
11 changed files with 48 additions and 31 deletions
14
src/js/util/escapeString.js
Normal file
14
src/js/util/escapeString.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
var mapping = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
"'": ''',
|
||||
'/': '/'
|
||||
};
|
||||
|
||||
module.exports = function(string) {
|
||||
return ('' + string).replace(/[&<>"'\/]/g, function(match) {
|
||||
return mapping[match];
|
||||
});
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue