mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
lib: replace var to let in cli_table.js
PR-URL: https://github.com/nodejs/node/pull/30400 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
committed by
Gireesh Punathil
parent
8acb646478
commit
78b7ddff1b
@@ -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;
|
||||
@@ -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] =
|
||||
|
||||
Reference in New Issue
Block a user