Skip to content

Commit 599bd72

Browse files
committed
url takes precedence over filepath
1 parent 3659dfc commit 599bd72

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/extractors/BaseCSVExtractor.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ const { CSVFileModule, CSVURLModule } = require('../modules');
44
class BaseCSVExtractor extends Extractor {
55
constructor({ filePath, url, csvSchema, unalterableColumns }) {
66
super();
7-
this.unalterableColumns = unalterableColumns || [];
8-
this.csvSchema = csvSchema;
9-
if (filePath) {
10-
this.filePath = filePath;
11-
this.csvModule = new CSVFileModule(this.filePath, this.unalterableColumns);
12-
} else if (url) {
7+
if (url) {
8+
this.unalterableColumns = unalterableColumns || [];
9+
this.csvSchema = csvSchema;
1310
this.url = url;
1411
this.csvModule = new CSVURLModule(this.url, this.unalterableColumns);
12+
} else if (filePath) {
13+
this.filePath = filePath;
14+
this.csvModule = new CSVFileModule(this.filePath, this.unalterableColumns);
1515
} else {
1616
throw new Error('Trying to instantiate a CSVExtractor without a filePath or url');
1717
}

0 commit comments

Comments
 (0)