Skip to content

Commit 3793cac

Browse files
committed
Code Tidy
1 parent 4a0819f commit 3793cac

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

services/speech_to_text/v1.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ module.exports = function (RED) {
323323

324324
function cloneQS(original) {
325325
// First create an empty object that will receive copies of properties
326-
let clone = {}, i, keys = Object.keys(original);
326+
let clone = {}, i = 0, keys = Object.keys(original);
327327

328328
for (i = 0; i < keys.length; i++) {
329329
// copy each property into the clone
@@ -364,8 +364,8 @@ module.exports = function (RED) {
364364
request(requestSettings, (error, response, body) => {
365365
//console.log('--------- request has been executed ---------------');
366366

367-
if (!error && response.statusCode == 200) {
368-
data = JSON.parse(body);
367+
if (!error && response.statusCode === 200) {
368+
let data = JSON.parse(body);
369369
resolve(data);
370370
} else if (error) {
371371
reject(error);
@@ -407,7 +407,7 @@ module.exports = function (RED) {
407407
})
408408
.catch((err) => {
409409
reject(err);
410-
})
410+
});
411411
});
412412
return p;
413413
}

utilities/iam-utils.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ class IAMUtils {
3939

4040
static stashToken(key, tokenInfo) {
4141
if (! IAMUtils.tokenStash) {
42-
IAMUtils.tokenStash = {};
42+
IAMUtils.tokenStash = {};
4343
}
4444
IAMUtils.tokenStash[key] = {};
4545
['access_token', 'refresh_token', 'expires_in', 'expiration'].forEach((f) => {
4646
IAMUtils.tokenStash[key][f] = tokenInfo[f] ? tokenInfo[f] : null;
47-
})
47+
});
4848
}
4949

5050
static checkForToken(key) {
@@ -88,7 +88,7 @@ class IAMUtils {
8888
response_type: 'cloud_iam'
8989
}
9090
}, (error, response, body) => {
91-
if (!error && response.statusCode == 200) {
91+
if (!error && response.statusCode === 200) {
9292
//console.log('Token body looks like : ', body);
9393
var b = JSON.parse(body);
9494
//console.log('Token body looks like : ', b);

0 commit comments

Comments
 (0)