aboutsummaryrefslogtreecommitdiff
path: root/src/lib/display.ts
diff options
context:
space:
mode:
authorBobby <[email protected]>2022-01-26 14:02:00 -0500
committerBobby <[email protected]>2022-01-26 14:02:00 -0500
commitdca40908a25b155dfed169f0260ec3083df90ed1 (patch)
tree58881f81ab9fff311a7618a158ae6e85bd13f609 /src/lib/display.ts
parent901901f0cc4795305d368f588a2d18fe2a8e28b2 (diff)
downloadizuku.js-dca40908a25b155dfed169f0260ec3083df90ed1.tar.xz
izuku.js-dca40908a25b155dfed169f0260ec3083df90ed1.zip
chore: remove table dependency and replace it with internal function
Diffstat (limited to 'src/lib/display.ts')
-rw-r--r--src/lib/display.ts7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/display.ts b/src/lib/display.ts
index 2ec19d9..d56b9d9 100644
--- a/src/lib/display.ts
+++ b/src/lib/display.ts
@@ -1,5 +1,4 @@
import { Frame } from '../index';
-import { table } from 'table';
import { Table } from '../helpers/tableBuilder';
/**
@@ -80,7 +79,7 @@ export function show(this: Frame): void {
} else {
const numberOfRows = this.rowdata.length;
if (numberOfRows < 7) {
- console.log(table(getTable(this.rowdata, this.columns)));
+ displayTable(getTable(this.rowdata, this.columns));
} else {
const firstThreeRows = this.rowdata.slice(0, 3);
const lastThreeRows = this.rowdata.slice(numberOfRows - 3);
@@ -121,7 +120,7 @@ export function head(this: Frame, n = 5): void {
// Generate the index row
const indexRow = this.rowdata.map((row, index) => index);
const data = this.rowdata.slice(0, n);
- console.log(table(getTable(data, this.columns, indexRow)));
+ displayTable(getTable(data, this.columns, indexRow));
}
}
@@ -145,6 +144,6 @@ export function tail(this: Frame, n = 5): void {
const data = this.rowdata.slice(this.rowdata.length - n);
// Slice the index row to match the data
const slicedIndexRow = indexRow.slice(indexRow.length - n);
- console.log(table(getTable(data, this.columns, slicedIndexRow)));
+ displayTable(getTable(data, this.columns, slicedIndexRow));
}
}