xml-sanitizer
Advanced tools
Comparing version 1.1.5 to 1.1.6
@@ -5,7 +5,8 @@ // A list of invalid XML characters can be found at https://www.w3.org/TR/2000/REC-xml-20001006#NT-Char | ||
var stripAnsi = require('strip-ansi'); | ||
var BAD_JUJU = /[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007f-\u0084\u0086-\u009f\uD800-\uDFFF\uFDD0-\uFDFF\uFFFF\uC008]/g; | ||
function xmlSanitizer(string, replacement) { | ||
return stripAnsi(string.replace(/[\u0000-\u0008]|\u000B|\u000C|[\u000E-\u001F]|[\u007f-\u0084]|[\u0086-\u009f]|[\uD800-\uDFFF]|[\uFDD0-\uFDFF]|\uFFFF|\uC008/g, replacement || '')); | ||
return stripAnsi(string.replace(BAD_JUJU, replacement || '')); | ||
} | ||
module.exports = xmlSanitizer; |
{ | ||
"name": "xml-sanitizer", | ||
"version": "1.1.5", | ||
"version": "1.1.6", | ||
"description": "Sanitize out invalid xml characters from your strings", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4976
107