7digital-api
Advanced tools
Comparing version 0.4.2 to 0.4.3
@@ -27,2 +27,4 @@ var xml2js = require('xml2js'), | ||
ResponseParser.prototype.normaliseResourceArrays = function (response) { | ||
var items; | ||
underscore([ | ||
@@ -37,4 +39,3 @@ 'tracks.track', | ||
'tags.tag', | ||
'taggedResults.taggedItem', | ||
'basketItems.basketItem' | ||
'taggedResults.taggedItem' | ||
]).each(function checkLength(item) { | ||
@@ -51,2 +52,9 @@ var parts = item.split('.'), | ||
if (response.basket && response.basket.basketItems | ||
&& response.basket.basketItems.basketItem) { | ||
items = response.basket.basketItems.basketItem; | ||
items = items.length ? items : [items]; | ||
response.basket.basketItems = items; | ||
} | ||
return response; | ||
@@ -89,3 +97,2 @@ }; | ||
delete result['xsi:noNamespaceSchemaLocation']; | ||
if (result.status === 'error') { | ||
@@ -99,3 +106,2 @@ callback(result.error); | ||
}); | ||
parser.parseString(response + ''); | ||
@@ -102,0 +108,0 @@ }; |
{ | ||
"name": "7digital-api", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"description": "Simple 7digital API wrapper for nodeJS", | ||
@@ -5,0 +5,0 @@ "homepage": [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70457
43
998