aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBobby <[email protected]>2022-01-26 14:28:32 -0500
committerBobby <[email protected]>2022-01-26 14:28:32 -0500
commit441083bfe0b88073bc2745ef0d84dbeb6902b854 (patch)
treeb8e9b8d150ff50895e7da6ec7ea3b1e063ffaf6c
parent586c2f8e7386e001e69ccaf89c7b200481aaec14 (diff)
downloadizuku.js-441083bfe0b88073bc2745ef0d84dbeb6902b854.tar.xz
izuku.js-441083bfe0b88073bc2745ef0d84dbeb6902b854.zip
fix: add title to constructor
-rw-r--r--src/index.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/index.ts b/src/index.ts
index 2e35bb7..99482be 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -18,13 +18,18 @@ class Izuku {
shape = '0 x 0';
tableTitle = '';
- constructor(rowdata?: Array<unknown[]>, columns?: Array<string>) {
+ constructor(
+ rowdata?: Array<unknown[]>,
+ columns?: Array<string>,
+ title?: string
+ ) {
this.rowdata = rowdata || [];
this.columns = columns
? setHeader(this.rowdata, columns)
: generateHeader(this.rowdata);
this.size = getSize(this.rowdata);
this.shape = `${this.rowdata.length} x ${this.columns.length}`;
+ this.tableTitle = title || '';
}
public data = data;