Socket
Socket
Sign inDemoInstall

fast-xml-parser

Package Overview
Dependencies
Maintainers
1
Versions
136
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-xml-parser - npm Package Compare versions

Comparing version 3.21.0 to 3.21.1

8

package.json
{
"name": "fast-xml-parser",
"version": "3.21.0",
"version": "3.21.1",
"description": "Validate XML or Parse XML to JS/JSON very fast without C/C++ based libraries",
"main": "./src/parser.js",
"scripts": {
"test": "npx nyc jasmine spec/*spec.js",
"test": "nyc --reporter=lcov --reporter=text jasmine spec/*spec.js",
"unit": "jasmine",
"coverage": "npx nyc report --reporter html --reporter text -t .nyc_output --report-dir .nyc_output/summary",
"coverage": "nyc report --reporter html --reporter text -t .nyc_output --report-dir .nyc_output/summary",
"perf": "node ./benchmark/perfTest3.js",

@@ -80,2 +80,3 @@ "lint": "eslint src/*.js spec/*.js",

"nimnjs": "^1.3.2",
"nyc": "^15.1.0",
"prettier": "^1.19.1",

@@ -92,5 +93,4 @@ "publish-please": "^5.5.2",

"dependencies": {
"nyc": "^15.1.0",
"strnum": "^1.0.4"
}
}

@@ -58,2 +58,4 @@ 'use strict';

this.processTextOrObjNode = processTextOrObjNode
if (this.options.format) {

@@ -95,6 +97,3 @@ this.indentate = indentate;

let val = '';
const keys = Object.keys(jObj);
const len = keys.length;
for (let i = 0; i < len; i++) {
const key = keys[i];
for (let key in jObj) {
if (typeof jObj[key] === 'undefined') {

@@ -148,4 +147,3 @@ // supress undefined node

} else if (typeof item === 'object') {
const result = this.j2x(item, level + 1);
val += this.buildObjNode(result.val, key, result.attrStr, level);
val += this.processTextOrObjNode(item, key, level)
} else {

@@ -165,4 +163,3 @@ val += this.buildTextNode(item, key, '', level);

} else {
const result = this.j2x(jObj[key], level + 1);
val += this.buildObjNode(result.val, key, result.attrStr, level);
val += this.processTextOrObjNode(jObj[key], key, level)
}

@@ -174,2 +171,11 @@ }

function processTextOrObjNode (object, key, level) {
const result = this.j2x(object, level + 1);
if (object[this.options.textNodeName] !== undefined && Object.keys(object).length === 1) {
return this.buildTextNode(result.val, key, result.attrStr, level);
} else {
return this.buildObjNode(result.val, key, result.attrStr, level);
}
}
function replaceCDATAstr(str, cdata) {

@@ -197,3 +203,3 @@ str = this.options.tagValueProcessor('' + str);

function buildObjectNode(val, key, attrStr, level) {
if (attrStr && !val.includes('<')) {
if (attrStr && val.indexOf('<') === -1) {
return (

@@ -200,0 +206,0 @@ this.indentate(level) +

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