Skip to content

Commit

Permalink
app/model/csv-data-loader.ts - allow blank lines in CSVs
Browse files Browse the repository at this point in the history
The the parser sees an EOL on the final line as denoting an invalid
blank line. When in fact that's kind of normal for CSVs, at least on
Unix. And so we will get an error on every CSV we parse with such a
final EOL. We probably care about spurious blank lines less than
spurious errors like this, so let's use this option, which seems to be
the only (simple?) workaround.

Discussed here: mholt/PapaParse#150
  • Loading branch information
Nick Stokoe committed Mar 13, 2024
1 parent 4fd3a33 commit cfd45ef
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/map-app/app/model/csv-data-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export class CsvDataLoader<R extends object = string[]> implements DataLoader<In
step: onStep,
complete: onComplete,
error: onError,
skipEmptyLines: true,
};
parse(this.url, config);
};
Expand Down

0 comments on commit cfd45ef

Please sign in to comment.