sorensen / ascii-table

Ascii Tables for JS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove clearRows, clear, addRow,

gajus opened this issue · comments

These methods unnecessarily abstract table data. Table data is just an array of arrays. A single method along the lines of https://github.com/sorensen/ascii-table#instanceaddrowmatrixrows is sufficient to instantiate table data.

Having data in an array enables developer to append rows, remove selected rows, etc. using regular array functions.

@gajus so then are you suggesting that the table always use a reference to the input array?

I agree with other requests to reduce the API complexity, but this is another issue in itself. What I prefer in building APIs or utilities is to never alter the user input. Because of this, the library can only hold a copy of the user input as to not alter it, and must have some methods of altering the internally stored data.

I would be in favor of simplifying this, but removing these methods does not solve anything. Marking this as closed as it will not be implemented, though it may be included in an API redesign.