Socket
Socket
Sign inDemoInstall

wsdlrdr

Package Overview
Dependencies
50
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.5.2 to 0.5.3

5

package.json
{
"name": "wsdlrdr",
"version": "0.5.2",
"version": "0.5.3",
"description": "a simple wsdl parser, with promises",

@@ -8,3 +8,4 @@ "main": "./src/index.js",

"request": "^2.88.0",
"xmldoc": "^1.1.2"
"xmldoc": "^1.1.2",
"deepmerge": "^3.2.0"
},

@@ -11,0 +12,0 @@ "devDependencies": {

31

src/index.js

@@ -6,2 +6,3 @@ (() => {

const request = require('request');
const deepmerge = require('deepmerge');

@@ -314,22 +315,21 @@ const fs = require('fs');

if (xmlElementChildrens.length !== 0) {
return xmlElementChildrens.reduce((store, $childItem) => {
let test = xmlElementChildrens.reduce((store, $childItem) => {
if (store[elementName]) {
if (!Array.isArray(store[elementName])) {
store[elementName] = [store[elementName]];
}
const addable = getValFromXmlElement($childItem);
if (addable) {
if (Object(store[elementName]) === store[elementName]) {
for (let addKey of Object.keys(addable)) {
if (store[elementName][addKey]) {
if (!Array.isArray(store[elementName][addKey])) {
store[elementName][addKey] = [store[elementName][addKey]];
}
const pushable = getValFromXmlElement($childItem);
if (pushable) {
for (let pushKey of Object.keys(pushable)) {
const pushItemFound = store[elementName].find((storeItem) => storeItem[pushKey]);
if (pushItemFound) {
if (!Array.isArray(pushItemFound[pushKey])) {
pushItemFound[pushKey] = [pushItemFound[pushKey]];
store[elementName][addKey].push(addable[addKey]);
} else {
store[elementName][addKey] = addable[addKey];
}
pushItemFound[pushKey].push(pushable[pushKey]);
return store;
}
return store;
}
store[elementName].push(pushable);
}

@@ -342,2 +342,3 @@ } else {

}, {});
return test;
}

@@ -344,0 +345,0 @@ }

@@ -124,6 +124,4 @@ (() => {

var dataAsJson = Wsdlrdr.getXmlDataAsJson(responseXml);
dataAsJson.forEach((dataItem) => {
if (dataItem.testResponseItem1) t.pass('testResponseItem1 is available');
if (dataItem.testResponseItem2) t.pass('testResponseItem2 is available');
});
if (dataAsJson.testResponseItem1) t.pass('testResponseItem1 is available');
if (dataAsJson.testResponseItem2) t.pass('testResponseItem2 is available');
});

@@ -178,5 +176,4 @@

var dataAsJson = Wsdlrdr.getXmlDataAsJson(responseXml);
t.ok(dataAsJson.getDataTypeResponse, 'getDataTypeResponse is available');
t.ok(dataAsJson.getDataTypeResponse.filter((i) => i['testParam2']).length === 1, 'testParam2 only once');
t.ok(dataAsJson.getDataTypeResponse.testParam2.length === 2, 'testParam2 got 2 items');

@@ -183,0 +180,0 @@ t.end();

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc