Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Commit

Permalink
fix: fix table output with simple columns
Browse files Browse the repository at this point in the history
  • Loading branch information
WillieRuemmele committed Apr 7, 2022
1 parent b3ee206 commit 7c8a65a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/ux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ export class UX {
if (this.isOutputEnabled) {
// This is either an array of column names or an already built Partial<OclifTableOptions>
if (isArray(columns)) {
const tableColumns: Partial<CliUx.Table.table.Columns<Record<string, unknown>>> = {};
const tableColumns: CliUx.Table.table.Columns<Record<string, unknown>> = {};
for (const col of columns) {
tableColumns[col] = {
header: col
Expand All @@ -303,7 +303,7 @@ export class UX {
.join(' '),
};
}
this.cli.ux.table(rows, { columns: tableColumns }, options);
this.cli.ux.table(rows, tableColumns, options);
} else {
this.cli.ux.table(rows, columns, options);
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/ux.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ describe('UX', () => {
expect(info.called).to.equal(true);
expect(info.firstCall.args[0]).to.equal(tableData);
expect(retVal.x).to.deep.equal(tableData);
expect(retVal.y.columns).to.deep.equal(expectedOptions);
expect(retVal.y).to.deep.equal(expectedOptions);
expect(ux1).to.equal(ux);
});

Expand Down

0 comments on commit 7c8a65a

Please sign in to comment.