@@ -5387,7 +5387,7 @@ var csv_parse = (function (exports) {
5387
5387
// Normalize option `record_delimiter`
5388
5388
if ( options . record_delimiter === undefined ) {
5389
5389
options . record_delimiter = [ ] ;
5390
- } else if ( typeof options . record_delimiter === 'string' || isBuffer ( options . record_delimiter ) ) {
5390
+ } else if ( typeof options . record_delimiter === 'string' || isBuffer ( options . record_delimiter ) ) {
5391
5391
if ( options . record_delimiter . length === 0 ) {
5392
5392
throw new CsvError ( 'CSV_INVALID_OPTION_RECORD_DELIMITER' , [
5393
5393
'Invalid option `record_delimiter`:' ,
@@ -5404,7 +5404,7 @@ var csv_parse = (function (exports) {
5404
5404
] , options ) ;
5405
5405
}
5406
5406
options . record_delimiter = options . record_delimiter . map ( function ( rd , i ) {
5407
- if ( typeof rd !== 'string' && ! isBuffer ( rd ) ) {
5407
+ if ( typeof rd !== 'string' && ! isBuffer ( rd ) ) {
5408
5408
throw new CsvError ( 'CSV_INVALID_OPTION_RECORD_DELIMITER' , [
5409
5409
'Invalid option `record_delimiter`:' ,
5410
5410
'value must be a string, a buffer or array of string|buffer' ,
@@ -5424,12 +5424,6 @@ var csv_parse = (function (exports) {
5424
5424
}
5425
5425
return rd ;
5426
5426
} ) ;
5427
- // Normalize option `relax`
5428
- if ( typeof options . relax === 'boolean' ) ; else if ( options . relax === undefined || options . relax === null ) {
5429
- options . relax = false ;
5430
- } else {
5431
- throw new Error ( `Invalid Option: relax must be a boolean, got ${ JSON . stringify ( options . relax ) } ` ) ;
5432
- }
5433
5427
// Normalize option `relax_column_count`
5434
5428
if ( typeof options . relax_column_count === 'boolean' ) ; else if ( options . relax_column_count === undefined || options . relax_column_count === null ) {
5435
5429
options . relax_column_count = false ;
@@ -5446,6 +5440,12 @@ var csv_parse = (function (exports) {
5446
5440
} else {
5447
5441
throw new Error ( `Invalid Option: relax_column_count_more must be a boolean, got ${ JSON . stringify ( options . relax_column_count_more ) } ` ) ;
5448
5442
}
5443
+ // Normalize option `relax_quotes`
5444
+ if ( typeof options . relax_quotes === 'boolean' ) ; else if ( options . relax_quotes === undefined || options . relax_quotes === null ) {
5445
+ options . relax_quotes = false ;
5446
+ } else {
5447
+ throw new Error ( `Invalid Option: relax_quotes must be a boolean, got ${ JSON . stringify ( options . relax_quotes ) } ` ) ;
5448
+ }
5449
5449
// Normalize option `skip_empty_lines`
5450
5450
if ( typeof options . skip_empty_lines === 'boolean' ) ; else if ( options . skip_empty_lines === undefined || options . skip_empty_lines === null ) {
5451
5451
options . skip_empty_lines = false ;
@@ -5588,7 +5588,7 @@ var csv_parse = (function (exports) {
5588
5588
}
5589
5589
// Central parser implementation
5590
5590
__parse ( nextBuf , end ) {
5591
- const { bom, comment, escape, from_line, ltrim, max_record_size, quote, raw, relax , rtrim, skip_empty_lines, to, to_line} = this . options ;
5591
+ const { bom, comment, escape, from_line, ltrim, max_record_size, quote, raw, relax_quotes , rtrim, skip_empty_lines, to, to_line} = this . options ;
5592
5592
let { record_delimiter} = this . options ;
5593
5593
const { bomSkipped, previousBuf, rawBuffer, escapeIsQuote} = this . state ;
5594
5594
let buf ;
@@ -5701,7 +5701,7 @@ var csv_parse = (function (exports) {
5701
5701
this . state . wasQuoting = true ;
5702
5702
pos += quote . length - 1 ;
5703
5703
continue ;
5704
- } else if ( relax === false ) {
5704
+ } else if ( relax_quotes === false ) {
5705
5705
const err = this . __error (
5706
5706
new CsvError ( 'CSV_INVALID_CLOSING_QUOTE' , [
5707
5707
'Invalid Closing Quote:' ,
@@ -5720,8 +5720,8 @@ var csv_parse = (function (exports) {
5720
5720
}
5721
5721
} else {
5722
5722
if ( this . state . field . length !== 0 ) {
5723
- // In relax mode, treat opening quote preceded by chrs as regular
5724
- if ( relax === false ) {
5723
+ // In relax_quotes mode, treat opening quote preceded by chrs as regular
5724
+ if ( relax_quotes === false ) {
5725
5725
const err = this . __error (
5726
5726
new CsvError ( 'INVALID_OPENING_QUOTE' , [
5727
5727
'Invalid Opening Quote:' ,
0 commit comments