Skip to content

Commit

Permalink
feat(bom): strip byte-order-mark from CSV files (#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
missinglink authored Dec 1, 2021
1 parent 8bf6674 commit fd05c4d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions lib/streams/recordStream.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
const fs = require( 'fs' );
const path = require( 'path' );

const csvParse = require( 'csv-parse' );
const combinedStream = require( 'combined-stream' );
const _ = require( 'lodash' );
const _ = require('lodash');
const fs = require('fs');
const path = require('path');
const csvParse = require('csv-parse').parse;
const combinedStream = require('combined-stream');
const through = require('through2');
const split = require('split2');

const logger = require( 'pelias-logger' ).get( 'openaddresses' );
const logger = require('pelias-logger').get('openaddresses');
const config = require('pelias-config').generate();

const CleanupStream = require('./cleanupStream');
Expand Down Expand Up @@ -100,6 +99,7 @@ function fileStreamDispatcher(stream, filePath) {
}

return stream.pipe(csvParse({
bom: true,
trim: true,
skip_empty_lines: true,
relax_column_count: true,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"async": "^3.1.0",
"bottleneck": "^2.19.5",
"combined-stream": "^1.0.7",
"csv-parse": "^4.0.0",
"csv-parse": "^5.0.3",
"fs-extra": "^8.1.0",
"glob": "^7.0.0",
"lodash": "^4.16.0",
Expand Down

0 comments on commit fd05c4d

Please sign in to comment.