Skip to content

Commit

Permalink
feat(table): add .body() method to Table
Browse files Browse the repository at this point in the history
  • Loading branch information
c4spar committed Jul 26, 2020
1 parent 866b71e commit 2526ff2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/table/lib/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ export class Table extends Array<IRow> {
Table.from( rows ).render();
}

public body( rows: IRow[] ): this {
this.length = 0;
this.push( ...rows );
return this;
}

public render(): void {
Deno.stdout.writeSync( encode( this.toString() ) );
}
Expand Down

0 comments on commit 2526ff2

Please sign in to comment.