Skip to content

Commit 5471985

Browse files
committed
fix(csv-parse): remove support for cast_date, no test
1 parent 6b34c28 commit 5471985

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

packages/csv-parse/lib/browser/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ var Parser = /*#__PURE__*/function (_Transform) {
267267
var date = Date.parse(value);
268268
return !isNaN(date) ? new Date(date) : value;
269269
};
270-
} else if (typeof options.cast_date !== 'function') {
270+
} else {
271271
throw new CsvError('CSV_INVALID_OPTION_CAST_DATE', ['Invalid option cast_date:', 'cast_date must be true or a function,', "got ".concat(JSON.stringify(options.cast_date))], options);
272272
} // Normalize option `columns`
273273

packages/csv-parse/lib/browser/sync.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ var Parser = /*#__PURE__*/function (_Transform) {
267267
var date = Date.parse(value);
268268
return !isNaN(date) ? new Date(date) : value;
269269
};
270-
} else if (typeof options.cast_date !== 'function') {
270+
} else {
271271
throw new CsvError('CSV_INVALID_OPTION_CAST_DATE', ['Invalid option cast_date:', 'cast_date must be true or a function,', "got ".concat(JSON.stringify(options.cast_date))], options);
272272
} // Normalize option `columns`
273273

packages/csv-parse/lib/es5/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ var Parser = /*#__PURE__*/function (_Transform) {
159159
var date = Date.parse(value);
160160
return !isNaN(date) ? new Date(date) : value;
161161
};
162-
} else if (typeof options.cast_date !== 'function') {
162+
} else {
163163
throw new CsvError('CSV_INVALID_OPTION_CAST_DATE', ['Invalid option cast_date:', 'cast_date must be true or a function,', "got ".concat(JSON.stringify(options.cast_date))], options);
164164
} // Normalize option `columns`
165165

packages/csv-parse/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class Parser extends Transform {
8686
const date = Date.parse(value)
8787
return !isNaN(date) ? new Date(date) : value
8888
}
89-
}else if(typeof options.cast_date !== 'function'){
89+
}else{
9090
throw new CsvError('CSV_INVALID_OPTION_CAST_DATE', [
9191
'Invalid option cast_date:', 'cast_date must be true or a function,',
9292
`got ${JSON.stringify(options.cast_date)}`

0 commit comments

Comments
 (0)