From 84bf79b50cf895bb858f63f4bffa59acafa55b3e Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 20 Sep 2018 12:29:40 -0700 Subject: [PATCH] Enable prefer-const in the eslint config (#102) --- video-intelligence/analyze.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/video-intelligence/analyze.js b/video-intelligence/analyze.js index 9b7751ba01..f907245113 100644 --- a/video-intelligence/analyze.js +++ b/video-intelligence/analyze.js @@ -49,7 +49,7 @@ function analyzeLabelsGCS(gcsUri) { labels.forEach(label => { console.log(`Label ${label.entity.description} occurs at:`); label.segments.forEach(segment => { - let time = segment.segment; + const time = segment.segment; if (time.startTimeOffset.seconds === undefined) { time.startTimeOffset.seconds = 0; } @@ -120,7 +120,7 @@ function analyzeLabelsLocal(path) { labels.forEach(label => { console.log(`Label ${label.entity.description} occurs at:`); label.segments.forEach(segment => { - let time = segment.segment; + const time = segment.segment; if (time.startTimeOffset.seconds === undefined) { time.startTimeOffset.seconds = 0; } @@ -329,9 +329,10 @@ function analyzeVideoTranscription(gcsUri) { const alternative = results[0].annotationResults[0].speechTranscriptions[0].alternatives[0]; alternative.words.forEach(wordInfo => { - let start_time = + const start_time = wordInfo.startTime.seconds + wordInfo.startTime.nanos * 1e-9; - let end_time = wordInfo.endTime.seconds + wordInfo.endTime.nanos * 1e-9; + const end_time = + wordInfo.endTime.seconds + wordInfo.endTime.nanos * 1e-9; console.log( '\t' + start_time + 's - ' + end_time + 's: ' + wordInfo.word );