Socket
Socket
Sign inDemoInstall

jstoxml

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jstoxml - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

2

jstoxml.js

@@ -17,3 +17,3 @@ var toXML = function(obj, config){

}
return txt.replace(new RegExp('(' + replacements.join('|') + ')', 'g'), function(str, entity) {
return String(txt).replace(new RegExp('(' + replacements.join('|') + ')', 'g'), function(str, entity) {
return mappings[entity] || '';

@@ -20,0 +20,0 @@ });

{
"name": "jstoxml",
"version": "0.2.1",
"version": "0.2.2",
"description": "Convert JSON to XML (for RSS, Podcasts, etc.)",

@@ -5,0 +5,0 @@ "homepage": "http://github.com/davidcalhoun/jstoxml",

@@ -13,3 +13,3 @@ jstoxml

* tabbed output (optional)
* custom filters (& -> &, etc) (optional)
* custom filters (<code>&</code> -> <code>&amp;</code>, etc) (optional)

@@ -16,0 +16,0 @@ ### Installation

@@ -536,2 +536,28 @@ var jstoxml = require('./jstoxml.js');

});
addTest({
name: 'bug4a',
input: function(){
return jstoxml.toXML({
foo: 4,
bar: '&'
});
},
expectedOutput: '<foo>4</foo><bar>&</bar>'
});
addTest({
name: 'bug4b',
input: function(){
return jstoxml.toXML({
foo: '&'
},
{
filter: {
'&': '&amp;'
}
});
},
expectedOutput: '<foo>&amp;</foo>'
});

@@ -538,0 +564,0 @@ runTests();

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