New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

watson-developer-cloud

Package Overview
Dependencies
Maintainers
3
Versions
217
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

watson-developer-cloud - npm Package Compare versions

Comparing version 2.6.1 to 2.6.2

lib/alchemy_error_formatter.js

20

alchemy-data-news/v1.js

@@ -23,20 +23,4 @@ /**

var BaseServiceAlchemy = require('../lib/base_service_alchemy');
var errorFormatter = require('../lib/alchemy_error_formatter');
function errorFormatter(cb) {
return function(err, result, response) {
if (err) {
cb(err, result);
}
else {
if (result.status === 'OK')
cb(err,result);
else
cb({
error: result.statusInfo || response['headers']['x-alchemyapi-error-msg'],
code: 400
}, null);
}
};
}
/**

@@ -63,3 +47,3 @@ * @param options

*/
AlchemyDataNewsV1.prototype.getNews = function(params, callback ) {
AlchemyDataNewsV1.prototype.getNews = function (params, callback ) {
params = params || {};

@@ -66,0 +50,0 @@

@@ -30,18 +30,3 @@ /**

var pick = require('object.pick');
function errorFormatter(cb) {
return function(err, result, response) {
if (err) {
cb(err, result);
}
else {
if (result.status === 'OK')
cb(err,result);
else
cb({
error: result.statusInfo || response['headers']['x-alchemyapi-error-msg'],
code: 400
}, null);
}
};
}
var errorFormatter = require('../lib/alchemy_error_formatter');

@@ -48,0 +33,0 @@ function createRequest(method) {

@@ -27,20 +27,4 @@ /**

var BaseServiceAlchemy = require('../lib/base_service_alchemy');
var errorFormatter = require('../lib/alchemy_error_formatter');
function errorFormatter(cb) {
return function(err, result, response) {
if (err) {
cb(err, result);
}
else {
if (result.status === 'OK')
cb(err,result);
else
cb({
error: result.statusInfo || response['headers']['x-alchemyapi-error-msg'],
code: 400
}, null);
}
};
}
function createRequest(method) {

@@ -47,0 +31,0 @@ return function(_params, callback ) {

@@ -0,1 +1,5 @@

# v2.6.1
* Ensure errors are always instanceof Error
* Doc improvements
# v2.6.0

@@ -2,0 +6,0 @@ * Added support for Personality Insights V3

@@ -45,6 +45,12 @@ /**

function formatErrorIfExists(cb) {
return function(error, response, body) {
return function(error, response, body) { // eslint-disable-line complexity
// If we have an error return it.
if (error) {
// first ensure that it's an instanceof Error
if ( !error instanceof Error) {
body = error;
error = new Error(error.message || error.error || error);
error.body = body;
}
cb(error, body, response);

@@ -51,0 +57,0 @@ return;

{
"name": "watson-developer-cloud",
"version": "2.6.1",
"version": "2.6.2",
"description": "Client library to use the IBM Watson Services and AlchemyAPI",

@@ -5,0 +5,0 @@ "main": "./lib/index",

@@ -1030,3 +1030,3 @@ /**

* @param {Object} params
* @param {String} params.classifier_id The classifier id
* @param {String} params.collection_id The collection id
* @param {ReadableStream} params.image_file The image file (.jpg or .png) of the image to search against the collection.

@@ -1033,0 +1033,0 @@ * @param {Number} [params.limit=10] limit The number of similar results you want returned. Default limit is 10 results, you can specify a maximum limit of 100 results.

Sorry, the diff of this file is not supported yet

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