Skip to content

Commit

Permalink
Sm/fix table stack error (#433)
Browse files Browse the repository at this point in the history
* test: watchable ut

* fix: giant tables don't exceed stack depth

* test: timeouts for windows

* test: move scale tests to e2e because slow

* test: e2e clone w/ https

* fix: turn null/undefined into empty string
  • Loading branch information
mshanemc committed Jun 23, 2022
1 parent 1a2342c commit a8b9604
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cli-ux/styled/table.ts
Expand Up @@ -19,7 +19,8 @@ class Table<T extends Record<string, unknown>> {
this.columns = Object.keys(columns).map((key: string) => {
const col = columns[key]
const extended = col.extended ?? false
const get = col.get ?? ((row: any) => row[key])
// turn null and undefined into empty strings by default
const get = col.get ?? ((row: any) => row[key] ?? '')
const header = typeof col.header === 'string' ? col.header : capitalize(key.replace(/_/g, ' '))
const minWidth = Math.max(col.minWidth ?? 0, sw(header) + 1)

Expand Down

0 comments on commit a8b9604

Please sign in to comment.