New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

raptor-util

Package Overview
Dependencies
Maintainers
2
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

raptor-util - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

27

escapeXml.js

@@ -6,8 +6,8 @@ var elTest = /[&<]/;

var replacements = {
'<': "&lt;",
'>': "&gt;",
'&': "&amp;",
'"': "&quot;",
"'": "&#39;",
'\n': "&#10;" //Preserve new lines so that they don't get normalized as space
'<': '&lt;',
'>': '&gt;',
'&': '&amp;',
'"': '&quot;',
'\'': '&#39;',
'\n': '&#10;' //Preserve new lines so that they don't get normalized as space
};

@@ -20,13 +20,16 @@

function escapeXml(str) {
if (typeof str === 'string' && elTest.test(str)) {
return str.replace(elTestReplace, replaceChar);
// check for most common case first
if (typeof str === 'string') {
return elTest.test(str) ? str.replace(elTestReplace, replaceChar) : str;
}
return str;
return (str == null) ? '' : str.toString();
}
function escapeXmlAttr(str) {
if (typeof str === 'string' && attrTest.test(str)) {
return str.replace(attrReplace, replaceChar);
if (typeof str === 'string') {
return attrTest.test(str) ? str.replace(attrReplace, replaceChar) : str;
}
return str;
return (str == null) ? '' : str.toString();
}

@@ -33,0 +36,0 @@

@@ -25,3 +25,3 @@ {

},
"version": "1.0.2"
"version": "1.0.3"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc