Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ebay-api

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

ebay-api - npm Package Compare versions

Comparing version 1.6.1 to 1.6.2

test/mocks/GetOrders-empty.xml

4

lib/json-parser.js

@@ -82,3 +82,5 @@ /**

parentObj[newKey] = parentObj[key][0][subKey];
// `compact` avoids creating an array of `[undefined]`,
// from input `['']` when xml "array" element was empty.
parentObj[newKey] = _.compact(parentObj[key][0][subKey]);
delete parentObj[key];

@@ -85,0 +87,0 @@

{
"name": "ebay-api",
"description": "eBay API Client",
"version": "1.6.1",
"version": "1.6.2",
"homepage": "https://github.com/benbuckman/nodejs-ebay-api",

@@ -6,0 +6,0 @@ "author": "Ben Buckman",

@@ -120,2 +120,43 @@ require('./helpers');

context('Empty Trading:GetOrders response', function() {
var responseXml, responseJson, parsedResponse;
var requestContext = {
serviceName: 'Trading',
opType: 'GetOrders',
parseDepth: -1
};
beforeEach('load mock response', function () {
responseXml = fs.readFileSync(path.resolve(__dirname, 'mocks', 'GetOrders-empty.xml'), {encoding: 'utf8'});
});
beforeEach('convert xml to json', function (done) {
convertXmlToJson(responseXml, requestContext, function (error, _json) {
if (error) return done(error);
responseJson = _json;
done();
});
});
beforeEach('parse json', function (done) {
parseResponseJson(responseJson, requestContext, function (error, _data) {
if (error) return done(error);
parsedResponse = _data;
done();
});
});
it('converted XML to JSON', function () {
expect(responseJson).to.have.property('GetOrdersResponse');
});
it('converted <OrderArray> to empty `Orders` array', function() {
expect(parsedResponse).to.have.property('Orders');
expect(parsedResponse).not.to.have.property('OrderArray');
expect(parsedResponse.Orders).to.have.length(0);
});
});
context('Shopping:GetMultipleItems response', function () {

@@ -122,0 +163,0 @@ var responseXml, responseJson, parsedResponse, requestContext;

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