Skip to content

Commit b735163

Browse files
sofislfhinkel
andauthored
feat: change JS to satisfy Dataflow JS engine (#1808)
Co-authored-by: F. Hinkelmann <[email protected]>
1 parent 8cd532c commit b735163

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

composer/composer_transform_csv_to_json.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* eslint-disable func-style */
2+
/* eslint-disable no-var */
23
// Copyright 2020 Google LLC
34
//
45
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,8 +20,8 @@ module.exports = function main(
1920
// [START composer_transform_csv_to_json]
2021

2122
function transformCSVtoJSON(line) {
22-
const values = line.split(',');
23-
const properties = [
23+
var values = line.split(',');
24+
var properties = [
2425
'location',
2526
'average_temperature',
2627
'month',
@@ -30,13 +31,13 @@ module.exports = function main(
3031
];
3132
const weatherInCity = {};
3233

33-
for (let count = 0; count < values.length; count++) {
34+
for (var count = 0; count < values.length; count++) {
3435
if (values[count] !== 'null') {
3536
weatherInCity[properties[count]] = values[count];
3637
}
3738
}
3839

39-
const jsonString = JSON.stringify(weatherInCity);
40+
var jsonString = JSON.stringify(weatherInCity);
4041
return jsonString;
4142
}
4243

0 commit comments

Comments
 (0)