@@ -5387,7 +5387,7 @@ var csv_parse = (function (exports) {
53875387 // Normalize option `record_delimiter`
53885388 if ( options . record_delimiter === undefined ) {
53895389 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 ) ) {
53915391 if ( options . record_delimiter . length === 0 ) {
53925392 throw new CsvError ( 'CSV_INVALID_OPTION_RECORD_DELIMITER' , [
53935393 'Invalid option `record_delimiter`:' ,
@@ -5404,7 +5404,7 @@ var csv_parse = (function (exports) {
54045404 ] , options ) ;
54055405 }
54065406 options . record_delimiter = options . record_delimiter . map ( function ( rd , i ) {
5407- if ( typeof rd !== 'string' && ! isBuffer ( rd ) ) {
5407+ if ( typeof rd !== 'string' && ! isBuffer ( rd ) ) {
54085408 throw new CsvError ( 'CSV_INVALID_OPTION_RECORD_DELIMITER' , [
54095409 'Invalid option `record_delimiter`:' ,
54105410 'value must be a string, a buffer or array of string|buffer' ,
@@ -5424,12 +5424,6 @@ var csv_parse = (function (exports) {
54245424 }
54255425 return rd ;
54265426 } ) ;
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- }
54335427 // Normalize option `relax_column_count`
54345428 if ( typeof options . relax_column_count === 'boolean' ) ; else if ( options . relax_column_count === undefined || options . relax_column_count === null ) {
54355429 options . relax_column_count = false ;
@@ -5446,6 +5440,12 @@ var csv_parse = (function (exports) {
54465440 } else {
54475441 throw new Error ( `Invalid Option: relax_column_count_more must be a boolean, got ${ JSON . stringify ( options . relax_column_count_more ) } ` ) ;
54485442 }
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+ }
54495449 // Normalize option `skip_empty_lines`
54505450 if ( typeof options . skip_empty_lines === 'boolean' ) ; else if ( options . skip_empty_lines === undefined || options . skip_empty_lines === null ) {
54515451 options . skip_empty_lines = false ;
@@ -5588,7 +5588,7 @@ var csv_parse = (function (exports) {
55885588 }
55895589 // Central parser implementation
55905590 __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 ;
55925592 let { record_delimiter} = this . options ;
55935593 const { bomSkipped, previousBuf, rawBuffer, escapeIsQuote} = this . state ;
55945594 let buf ;
@@ -5701,7 +5701,7 @@ var csv_parse = (function (exports) {
57015701 this . state . wasQuoting = true ;
57025702 pos += quote . length - 1 ;
57035703 continue ;
5704- } else if ( relax === false ) {
5704+ } else if ( relax_quotes === false ) {
57055705 const err = this . __error (
57065706 new CsvError ( 'CSV_INVALID_CLOSING_QUOTE' , [
57075707 'Invalid Closing Quote:' ,
@@ -5720,8 +5720,8 @@ var csv_parse = (function (exports) {
57205720 }
57215721 } else {
57225722 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 ) {
57255725 const err = this . __error (
57265726 new CsvError ( 'INVALID_OPENING_QUOTE' , [
57275727 'Invalid Opening Quote:' ,
0 commit comments