chore(wpcarro/ynabsql): Prefer let to var
"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>
This commit is contained in:
parent
989111857a
commit
b5d1ae4722
1 changed files with 9 additions and 9 deletions
|
@ -165,20 +165,20 @@ function transactionKey(x) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseCSV(csv) {
|
function parseCSV(csv) {
|
||||||
var lines=csv.split("\n");
|
let lines=csv.split("\n");
|
||||||
var result = [];
|
let result = [];
|
||||||
|
|
||||||
// Strip the surrounding 2x-quotes from the header.
|
// Strip the surrounding 2x-quotes from the header.
|
||||||
//
|
//
|
||||||
// NOTE: If your columns contain commas in their values, you'll need
|
// NOTE: If your columns contain commas in their values, you'll need
|
||||||
// to deal with those before doing the next step
|
// to deal with those before doing the next step
|
||||||
var headers = lines[0].split(",").map(x => x.slice(1, -1));
|
let headers = lines[0].split(",").map(x => x.slice(1, -1));
|
||||||
|
|
||||||
for(var i = 1; i < lines.length; i += 1) {
|
for(let i = 1; i < lines.length; i += 1) {
|
||||||
var obj = {};
|
let obj = {};
|
||||||
var currentline=lines[i].split(",");
|
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);
|
obj[headers[j]] = currentline[j].slice(1, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1225,7 +1225,7 @@ const Transactions = ({ sensitive, transactions, onSort, onClick, onViewChange,
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if (transactionsView === 'csv') {
|
else if (transactionsView === 'csv') {
|
||||||
view = (
|
view = (
|
||||||
<code>{tableHeaders.join(',') + '\n' + transactions.map(x => tableHeaders.map(k => x[k]).join(',')).join("\n")}</code>
|
<code>{tableHeaders.join(',') + '\n' + transactions.map(x => tableHeaders.map(k => x[k]).join(',')).join("\n")}</code>
|
||||||
|
|
Loading…
Reference in a new issue