Skip to content

Commit

Permalink
more flexible CSV parsing (#703)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathisonian authored Feb 28, 2021
1 parent 70808a1 commit ed3388a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/idyll-cli/src/resolvers/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ class DataResolver {
const inputString = fs.readFileSync(
slash(join(this.paths.DATA_DIR, source))
);
data = parse(inputString, { cast: true, columns: true });
data = parse(inputString, {
cast: true,
columns: true,
skip_empty_lines: true,
ltrim: true,
rtrim: true
});
debug(`${JSON.stringify(data)}`);
} else if (source.endsWith('.json')) {
debug(`Loading ${source} as a JSON document into data variable ${name}`);
Expand Down

0 comments on commit ed3388a

Please sign in to comment.