Comparing version 2.1.3 to 2.1.4
@@ -0,1 +1,4 @@ | ||
## 2.1.4 (2020-01-29) | ||
- Pass errors to debug function. | ||
## 2.1.3 (2017-11-21) | ||
@@ -2,0 +5,0 @@ - Fix bug in openBox endpoint that prevented searching for all open box items (null search). |
@@ -13,11 +13,14 @@ module.exports = debugLogger; | ||
debugFn = (data) => { | ||
var formattedData; | ||
try { | ||
formattedData = JSON.stringify(data, null, 2); | ||
} catch (err) { | ||
console.error('Error while trying to JSON format the data!', err.message, err.stack); | ||
formattedData = data; | ||
if (data.error) { | ||
console.error(data.error); | ||
} else { | ||
var formattedData; | ||
try { | ||
formattedData = JSON.stringify(data, null, 2); | ||
} catch (err) { | ||
console.error('Error while trying to JSON format the data!', err.message, err.stack); | ||
formattedData = data; | ||
} | ||
console.log(formattedData); | ||
} | ||
console.log(formattedData); | ||
}; | ||
@@ -71,4 +74,5 @@ } | ||
}, function (error) { | ||
debugFn({ error }); | ||
throw error; | ||
}); | ||
} |
{ | ||
"name": "bestbuy", | ||
"version": "2.1.3", | ||
"version": "2.1.4", | ||
"description": "High level node.js client for the Best Buy API.", | ||
@@ -37,3 +37,3 @@ "main": "index.js", | ||
"JSONStream": "^1.3.1", | ||
"axios": "^0.16.2", | ||
"axios": "^0.18.1", | ||
"limiter": "^1.1.0", | ||
@@ -50,4 +50,4 @@ "peek-stream": "^1.1.2", | ||
"tape": "^4.6.3", | ||
"tape-nock": "^1.4.0" | ||
"tape-nock": "1.4.1" | ||
} | ||
} |
@@ -424,3 +424,3 @@ # Best Buy API | ||
}); | ||
// The debug function will be called for each request and each response. | ||
// The debug function will be called for each request, response, and error thrown by the internal HTTP client. | ||
``` | ||
@@ -427,0 +427,0 @@ |
@@ -86,3 +86,3 @@ var test = require('./lib/tape-nock-setup'); | ||
// Do a search which emits an error | ||
bby.products('gurgleflats????4') | ||
bby.products('gurgleflats') | ||
.catch(function (data) { | ||
@@ -96,3 +96,3 @@ t.equals(data.status, 400, 'status 400 returned'); | ||
// Do a search which emits an error | ||
bby.products('gurgleflats????4', (err, result) => { | ||
bby.products('gurgleflats', (err, result) => { | ||
t.equals(err.status, 400, 'status 400 returned'); | ||
@@ -212,3 +212,3 @@ t.end(); | ||
// Do a search which emits an error | ||
var stream = bby.productsAsStream('gurgleflats????4', {format: 'xml'}); | ||
var stream = bby.productsAsStream('gurgleflats', {format: 'xml'}); | ||
@@ -215,0 +215,0 @@ stream.on('error', err => { |
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
AI-detected potential malware
Supply chain riskAI has identified this package as malware. This is a strong signal that the package may be malicious.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
AI-detected potential malware
Supply chain riskAI has identified this package as malware. This is a strong signal that the package may be malicious.
Found 1 instance in 1 package
1617775
122
29908
18
2
+ Addedaxios@0.18.1(transitive)
+ Addedfollow-redirects@1.5.10(transitive)
+ Addedis-buffer@2.0.5(transitive)
- Removedaxios@0.16.2(transitive)
- Removedfollow-redirects@1.15.9(transitive)
- Removedis-buffer@1.1.6(transitive)
Updatedaxios@^0.18.1