@syntest/cli-graphics
Advanced tools
Comparing version 0.2.1-beta.3 to 0.3.0-beta.0
@@ -34,5 +34,5 @@ import * as cliProgress from "cli-progress"; | ||
export type TableObject = { | ||
headers: string[]; | ||
headers?: string[]; | ||
rows: string[][]; | ||
footers: string[]; | ||
footers?: string[]; | ||
}; | ||
@@ -39,0 +39,0 @@ export type BarObject = { |
@@ -119,7 +119,11 @@ "use strict"; | ||
table(title, tableObject) { | ||
return (0, table_1.table)([ | ||
tableObject.headers.map((element) => this.bold(element)), | ||
...tableObject.rows, | ||
tableObject.footers.map((element) => this.bold(element)), | ||
], { | ||
const rows = []; | ||
if (tableObject.headers) { | ||
rows.push(tableObject.headers.map((element) => this.bold(element))); | ||
} | ||
rows.push(...tableObject.rows); | ||
if (tableObject.footers) { | ||
rows.push(tableObject.footers.map((element) => this.bold(element))); | ||
} | ||
return (0, table_1.table)(rows, { | ||
header: { | ||
@@ -126,0 +130,0 @@ alignment: "center", |
{ | ||
"name": "@syntest/cli-graphics", | ||
"version": "0.2.1-beta.3", | ||
"version": "0.3.0-beta.0", | ||
"description": "SynTest library for cli graphics", | ||
@@ -67,3 +67,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "62fc32cd877d4f37e335e5e21027b0913d7bcb75" | ||
"gitHead": "20ce3f59489341e9e9ba8f3a441b516a5d625d9a" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30923
251