Skip to content

Commit 490d576

Browse files
committed
code cleansing
1 parent de5de0a commit 490d576

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

services/discovery/discovery-utils.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ DiscoveryUtils.prototype = {
3939
this.isJsonObject(msg.payload);
4040

4141
// Payload (text to be analysed) must be a string (content is either raw string or Buffer)
42-
if (typeof msg.payload === 'string' || isJSON) {
42+
if (typeof msg.payload === 'string' || isJSON) {
4343
params.file = this.isJsonObject(msg.payload) ?
4444
JSON.stringify(msg.payload) :
4545
msg.payload;
@@ -64,14 +64,14 @@ DiscoveryUtils.prototype = {
6464
},
6565

6666
buildParams: function(msg, config) {
67-
var params = {};
67+
var params = {},
6868
me = this;
6969

7070
params = this.buildParamsForName(msg, config, params);
7171

7272
['environment_id','collection_id','configuration_id',
73-
'collection_name',
74-
'query','description','size'].forEach(function(f) {
73+
'collection_name',
74+
'query','description','size'].forEach(function(f) {
7575
params = me.buildParamsFor(msg, config, params, f);
7676
});
7777

services/tone_analyzer/v3.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ module.exports = function (RED) {
6666
// Function that checks the configuration to make sure that credentials,
6767
// payload and options have been provied in the correct format.
6868
var checkConfiguration = function(msg, node) {
69-
var message = null;
70-
var taSettings = null;
69+
var message = null,
70+
taSettings = null;
7171

7272
taSettings = checkCreds(node.credentials);
7373

@@ -136,7 +136,7 @@ module.exports = function (RED) {
136136
payloadutils.reportError(node,msg,err);
137137
node.send(msg);
138138
});
139-
}
139+
}
140140

141141

142142
// This is the Tone Analyzer Node.

utilities/tone-utils.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ ToneUtils.prototype = {
4242
// whether it is JSON or a Buffer
4343
checkPayload: function(payload) {
4444
var message = null;
45-
var isJSON = this.isJsonString(payload) || this.isJsonObject(payload);
45+
isJSON = this.isJsonString(payload) || this.isJsonObject(payload);
4646

4747
// Payload (text to be analysed) must be a string (content is either raw string or Buffer)
48-
if (typeof payload !== 'string' && isJSON !== true) {
48+
if (typeof payload !== 'string' && isJSON !== true) {
4949
message = 'The payload must be either a string, JSON or a Buffer';
5050
}
5151

@@ -78,7 +78,7 @@ ToneUtils.prototype = {
7878
options.text = this.isJsonObject(msg.payload) ?
7979
JSON.stringify(msg.payload) :
8080
msg.payload;
81-
break
81+
break;
8282
case 'customerEngagementTone' :
8383
options.utterances = this.isJsonString(msg.payload) ?
8484
JSON.parse(msg.payload) :

0 commit comments

Comments
 (0)