Skip to content

Commit dee8411

Browse files
committed
added comments for what the options do
1 parent ead7b16 commit dee8411

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/modules/CSVFileModule.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@ class CSVFileModule {
1010
// Parse then normalize the data
1111
const parsedData = parse(fs.readFileSync(csvFilePath), {
1212
columns: (header) => header.map((column) => stringNormalizer(column)),
13+
// https://csv.js.org/parse/options/bom/
1314
bom: true,
15+
// https://csv.js.org/parse/options/skip_empty_lines/
1416
skip_empty_lines: true,
17+
// NOTE: This will skip any records with empty values, not just skip the empty values themselves
18+
// https://csv.js.org/parse/options/skip_records_with_empty_values/
1519
skip_records_with_empty_values: true,
1620
});
1721
this.filePath = csvFilePath;
18-
1922
this.data = normalizeEmptyValues(parsedData, unalterableColumns);
2023
}
2124

0 commit comments

Comments
 (0)