diff options
| author | Priyansh <[email protected]> | 2022-01-22 21:58:09 -0500 |
|---|---|---|
| committer | Priyansh <[email protected]> | 2022-01-22 21:58:09 -0500 |
| commit | ece598200a50a53c9f74fb5252b977c49d571cfb (patch) | |
| tree | f7cb44c14b9f48f857a1c81530f6e2b1186a7054 /src/lib | |
| parent | 4700bb0fafd7c7b208168dda7425193bfe1eb4db (diff) | |
| download | izuku.js-ece598200a50a53c9f74fb5252b977c49d571cfb.tar.xz izuku.js-ece598200a50a53c9f74fb5252b977c49d571cfb.zip | |
fix: move shifting first row of readCSV() to remove only of no header is set
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/data.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/data.ts b/src/lib/data.ts index a89434b..8174096 100644 --- a/src/lib/data.ts +++ b/src/lib/data.ts @@ -75,9 +75,9 @@ export function fromCSV(this: Frame, csvpath: string): Frame { this.rowdata = rowdata; if (this.columns.length === 0) { this.columns = rowdata[0]; + // remove the first row + this.rowdata.shift(); } - // remove the first row - this.rowdata.shift(); // if last row contains only empty values, remove it if (this.rowdata[this.rowdata.length - 1].every((item) => item === '')) { |
