first commit
This commit is contained in:
18
build/node_modules/xml/lib/escapeForXML.js
generated
vendored
Normal file
18
build/node_modules/xml/lib/escapeForXML.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
var XML_CHARACTER_MAP = {
|
||||
'&': '&',
|
||||
'"': '"',
|
||||
"'": ''',
|
||||
'<': '<',
|
||||
'>': '>'
|
||||
};
|
||||
|
||||
function escapeForXML(string) {
|
||||
return string && string.replace
|
||||
? string.replace(/([&"<>'])/g, function(str, item) {
|
||||
return XML_CHARACTER_MAP[item];
|
||||
})
|
||||
: string;
|
||||
}
|
||||
|
||||
module.exports = escapeForXML;
|
||||
Reference in New Issue
Block a user