File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 1
1
/* eslint-disable func-style */
2
+ /* eslint-disable no-var */
2
3
// Copyright 2020 Google LLC
3
4
//
4
5
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,8 +20,8 @@ module.exports = function main(
19
20
// [START composer_transform_csv_to_json]
20
21
21
22
function transformCSVtoJSON ( line ) {
22
- const values = line . split ( ',' ) ;
23
- const properties = [
23
+ var values = line . split ( ',' ) ;
24
+ var properties = [
24
25
'location' ,
25
26
'average_temperature' ,
26
27
'month' ,
@@ -30,13 +31,13 @@ module.exports = function main(
30
31
] ;
31
32
const weatherInCity = { } ;
32
33
33
- for ( let count = 0 ; count < values . length ; count ++ ) {
34
+ for ( var count = 0 ; count < values . length ; count ++ ) {
34
35
if ( values [ count ] !== 'null' ) {
35
36
weatherInCity [ properties [ count ] ] = values [ count ] ;
36
37
}
37
38
}
38
39
39
- const jsonString = JSON . stringify ( weatherInCity ) ;
40
+ var jsonString = JSON . stringify ( weatherInCity ) ;
40
41
return jsonString ;
41
42
}
42
43
You can’t perform that action at this time.
0 commit comments