Skip to content

Commit 45d0600

Browse files
committed
Improve table cell width calc
1 parent 98999c9 commit 45d0600

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

packages/knip/src/util/table.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,7 @@ export class Table {
7575
const columnWidths = columns.reduce(
7676
(acc, col) => {
7777
acc[col] = Math.max(
78-
...this.rows.map(row =>
79-
row[col]?.formatted
80-
? stripVTControlCharacters(row[col].formatted).length
81-
: String(row[col]?.value || '').length
82-
)
78+
...this.rows.map(row => stripVTControlCharacters(row[col]?.formatted ?? String(row[col].value || '')).length)
8379
);
8480
return acc;
8581
},

0 commit comments

Comments
 (0)