ebay-promised
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -141,5 +141,23 @@ // Generated by CoffeeScript 1.9.1 | ||
parsed.results = Array.isArray(arr) ? arr : [arr]; | ||
return parsed; | ||
return utils.flatten(parsed); | ||
}; | ||
utils.flatten = function(o) { | ||
var i, key, len, memo, ref; | ||
if (o.value) { | ||
return o.value; | ||
} | ||
if (Array.isArray(o)) { | ||
return o.map(flatten); | ||
} else { | ||
memo = {}; | ||
ref = Object.keys(o); | ||
for (i = 0, len = ref.length; i < len; i++) { | ||
key = ref[i]; | ||
memo[key] = o[key].value ? o[key].value : flatten(o[key]); | ||
} | ||
return memo; | ||
} | ||
}; | ||
module.exports = utils; |
{ | ||
"name": "ebay-promised", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "promise wrapped Ebay requests with sensible response parsers", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
129197
499