🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

xml-mapping

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xml-mapping - npm Package Compare versions

Comparing version

to
1.5.0

t.js

4

lib/xml-mapping.js

@@ -209,3 +209,5 @@ 'use strict';

parser.oncomment = function (v) {
cvalue('$c', v);
if (options.comments === undefined || options.comments !== false) {
cvalue('$c', v);
}
};

@@ -212,0 +214,0 @@ parser.oncdata = function (v) {

{
"name": "xml-mapping",
"version": "1.4.1",
"version": "1.5.0",
"author": "Nicolas Thouvenin <nthouvenin@gmail.com>",

@@ -5,0 +5,0 @@ "contributors": [

@@ -62,2 +62,3 @@ # xml2json and json2xml for NodeJS

* `nested` - *boolean* - Flag to ignore nested tags inside text : *default : false*
* `comments` - *boolean* - Flag to ignore comments, if false all the comments will be ignored : *default : true*

@@ -64,0 +65,0 @@ ```javascript

@@ -174,2 +174,15 @@ var XMLMapping = require('../');

};
exports['t08a'] = function (test) {
input = '<!-- comment --><key1><key2 attr="value1"/><key3 attr="value2"/></key1>';
test.deepEqual(XMLMapping.load(input), { '$c': 'comment', key1 : { key2 : { attr : 'value1'}, key3 : { attr : 'value2'} } });
test.done();
};
exports['t08b'] = function (test) {
input = '<!-- comment --><key1><key2 attr="value1"/><key3 attr="value2"/></key1>';
test.deepEqual(XMLMapping.load(input, {comments: false}), { key1 : { key2 : { attr : 'value1'}, key3 : { attr : 'value2'} } });
test.done();
};
/* */