aboutsummaryrefslogtreecommitdiff
path: root/src/index.ts
blob: f4a56a2778e436e206ed2e9eab75893a4e8a3869 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { data, header } from './lib/frame';
import { getSingleColumnDetails } from './lib/locate';
import { show, head, tail } from './lib/display';

class Izuku {
  rowdata: unknown[][] = [];
  columns: string[] = [];

  constructor(rowdata?: Array<unknown[]>, columns?: Array<string>) {
    this.rowdata = rowdata || [];
    this.columns = columns || [];
  }

  public data = data;
  public header = header;
  public show = show;
  public head = head;
  public tail = tail;
  public column = (column: number | string) => {
    const izSampler = getSingleColumnDetails(this, column);
    return new Izuku(izSampler.rowd, izSampler.rowh);
  };
}

export = Izuku;