From ece598200a50a53c9f74fb5252b977c49d571cfb Mon Sep 17 00:00:00 2001 From: Priyansh Date: Sat, 22 Jan 2022 21:58:09 -0500 Subject: fix: move shifting first row of readCSV() to remove only of no header is set --- src/lib/data.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib') 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 === '')) { -- cgit v1.2.3