Skip to content

Commit

Permalink
lib: replace var to let in cli_table.js
Browse files Browse the repository at this point in the history
PR-URL: #30400
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: David Carlier <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
  • Loading branch information
Jing19 authored and MylesBorins committed Dec 17, 2019
1 parent 984c406 commit ff4f236
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/internal/cli_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const tableChars = {

const renderRow = (row, columnWidths) => {
let out = tableChars.left;
for (var i = 0; i < row.length; i++) {
for (let i = 0; i < row.length; i++) {
const cell = row[i];
const len = getStringWidth(cell);
const needed = (columnWidths[i] - len) / 2;
Expand All @@ -49,9 +49,9 @@ const table = (head, columns) => {
const columnWidths = head.map((h) => getStringWidth(h));
const longestColumn = columns.reduce((n, a) => Math.max(n, a.length), 0);

for (var i = 0; i < head.length; i++) {
for (let i = 0; i < head.length; i++) {
const column = columns[i];
for (var j = 0; j < longestColumn; j++) {
for (let j = 0; j < longestColumn; j++) {
if (rows[j] === undefined)
rows[j] = [];
const value = rows[j][i] =
Expand Down

0 comments on commit ff4f236

Please sign in to comment.