Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
lib: replaced var to let in lib/internal/cli_table.js
  • Loading branch information
Jing19 committed Nov 12, 2019
commit d71f2446418da8ff85b74c91dde18167f1a2da1e
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