diff options
author | William Carroll <wpcarro@gmail.com> | 2023-01-23T15·56-0800 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2023-01-23T16·00+0000 |
commit | b5d1ae4722d3f28f7ee005ddb402a212530f938f (patch) | |
tree | 64cedebc675027ae09c2c3db32b8e83328d96896 /users/wpcarro | |
parent | 989111857a338b1c66f5c5443c324d7151faa319 (diff) |
chore(wpcarro/ynabsql): Prefer let to var r/5745
"Something something modern JavaScript" Change-Id: I00abddd0a5b0abc4fcb4daee2d4ffa5189245d3b Reviewed-on: https://cl.tvl.fyi/c/depot/+/7916 Reviewed-by: wpcarro <wpcarro@gmail.com> Tested-by: BuildkiteCI Autosubmit: wpcarro <wpcarro@gmail.com>
Diffstat (limited to 'users/wpcarro')
-rw-r--r-- | users/wpcarro/ynabsql/dataviz/components.jsx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/users/wpcarro/ynabsql/dataviz/components.jsx b/users/wpcarro/ynabsql/dataviz/components.jsx index 191c83743475..0dbfc9fd801b 100644 --- a/users/wpcarro/ynabsql/dataviz/components.jsx +++ b/users/wpcarro/ynabsql/dataviz/components.jsx @@ -165,20 +165,20 @@ function transactionKey(x) { } function parseCSV(csv) { - var lines=csv.split("\n"); - var result = []; + let lines=csv.split("\n"); + let result = []; // Strip the surrounding 2x-quotes from the header. // // NOTE: If your columns contain commas in their values, you'll need - // to deal with those before doing the next step - var headers = lines[0].split(",").map(x => x.slice(1, -1)); + // to deal with those before doing the next step + let headers = lines[0].split(",").map(x => x.slice(1, -1)); - for(var i = 1; i < lines.length; i += 1) { - var obj = {}; - var currentline=lines[i].split(","); + for(let i = 1; i < lines.length; i += 1) { + let obj = {}; + let currentline=lines[i].split(","); - for(var j = 0; j < headers.length; j += 1) { + for(let j = 0; j < headers.length; j += 1) { obj[headers[j]] = currentline[j].slice(1, -1); } @@ -1225,7 +1225,7 @@ const Transactions = ({ sensitive, transactions, onSort, onClick, onViewChange, </tbody> </table> ); - } + } else if (transactionsView === 'csv') { view = ( <code>{tableHeaders.join(',') + '\n' + transactions.map(x => tableHeaders.map(k => x[k]).join(',')).join("\n")}</code> |