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

watson-developer-cloud

Package Overview
Dependencies
Maintainers
2
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 0.9.5 to 0.9.6

.editorconfig

28

examples/concept_insights.v1.js

@@ -11,2 +11,6 @@ 'use strict';

///////////////////
// Annotate text //
///////////////////
var params = {

@@ -25,1 +29,25 @@ user: 'wikipedia',

});
/////////////////////
// Semantic Search //
/////////////////////
var payload = {
func: 'semanticSearch',
ids: [
'/graph/wikipedia/en-20120601/Software_development_process',
'/graph/wikipedia/en-20120601/Programming_tool'
],
corpus: 'ibmresearcher',
user: 'public',
limit: 5
};
concept_insights.semanticSearch(payload, function(error, results) {
if (error)
console.log(error);
else
console.log(JSON.stringify(results, null, 2));
});

2

package.json
{
"name": "watson-developer-cloud",
"version": "0.9.5",
"version": "0.9.6",
"description": "Nodejs Client Wrapper to use the IBM Watson Services",

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

@@ -426,3 +426,3 @@ Watson Developer Cloud Nodejs Client

```sh
$ NODE_DEBUG='request' app.js
$ NODE_DEBUG='request' node app.js
```

@@ -429,0 +429,0 @@ where `app.js` is your nodejs file

@@ -287,2 +287,18 @@ /**

params = params || {};
// Initially, we expected the user to supply JSON.stringify'd ids. Now we expect an array of strings that we'll JSON.stringify our self.
// We still support the old version for backwards compatibility, BUT we don't want to accept any old string, only a valid JSON array, so we parse and check it to be sure.
if (!Array.isArray(params.ids)) {
try {
params.ids = JSON.parse(params.ids);
} catch (ex) {
// if it wasn't valid JSON, then it still won't be an array and we'll throw an error when we check that in a couple of lines
}
if (!Array.isArray(params.ids)) {
return process.nextTick(callback.bind(null, new Error("Invalid or missing required parameters: the ids param be an array of strings")));
}
}
params.ids = JSON.stringify(params.ids);
var parameters = {

@@ -289,0 +305,0 @@ options: {

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