File tree 8 files changed +32
-24
lines changed
8 files changed +32
-24
lines changed Original file line number Diff line number Diff line change @@ -6461,11 +6461,11 @@ class Parser extends Transform {
6461
6461
return 0 ;
6462
6462
}
6463
6463
__error ( msg ) {
6464
- const { skip_lines_with_error} = this . options ;
6464
+ const { encoding , raw , skip_lines_with_error} = this . options ;
6465
6465
const err = typeof msg === 'string' ? new Error ( msg ) : msg ;
6466
6466
if ( skip_lines_with_error ) {
6467
6467
this . state . recordHasError = true ;
6468
- this . emit ( 'skip' , err ) ;
6468
+ this . emit ( 'skip' , err , raw ? this . state . rawBuffer . toString ( encoding ) : undefined ) ;
6469
6469
return undefined ;
6470
6470
} else {
6471
6471
return err ;
@@ -6478,12 +6478,13 @@ class Parser extends Transform {
6478
6478
} ;
6479
6479
}
6480
6480
__infoRecord ( ) {
6481
- const { columns} = this . options ;
6481
+ const { columns, raw , encoding } = this . options ;
6482
6482
return {
6483
6483
...this . __infoDataSet ( ) ,
6484
6484
error : this . state . error ,
6485
6485
header : columns === true ,
6486
6486
index : this . state . record . length ,
6487
+ raw : raw ? this . state . rawBuffer . toString ( encoding ) : undefined
6487
6488
} ;
6488
6489
}
6489
6490
__infoField ( ) {
Original file line number Diff line number Diff line change @@ -6458,11 +6458,11 @@ class Parser extends Transform {
6458
6458
return 0 ;
6459
6459
}
6460
6460
__error ( msg ) {
6461
- const { skip_lines_with_error} = this . options ;
6461
+ const { encoding , raw , skip_lines_with_error} = this . options ;
6462
6462
const err = typeof msg === 'string' ? new Error ( msg ) : msg ;
6463
6463
if ( skip_lines_with_error ) {
6464
6464
this . state . recordHasError = true ;
6465
- this . emit ( 'skip' , err ) ;
6465
+ this . emit ( 'skip' , err , raw ? this . state . rawBuffer . toString ( encoding ) : undefined ) ;
6466
6466
return undefined ;
6467
6467
} else {
6468
6468
return err ;
@@ -6475,12 +6475,13 @@ class Parser extends Transform {
6475
6475
} ;
6476
6476
}
6477
6477
__infoRecord ( ) {
6478
- const { columns} = this . options ;
6478
+ const { columns, raw , encoding } = this . options ;
6479
6479
return {
6480
6480
...this . __infoDataSet ( ) ,
6481
6481
error : this . state . error ,
6482
6482
header : columns === true ,
6483
6483
index : this . state . record . length ,
6484
+ raw : raw ? this . state . rawBuffer . toString ( encoding ) : undefined
6484
6485
} ;
6485
6486
}
6486
6487
__infoField ( ) {
Original file line number Diff line number Diff line change @@ -6457,11 +6457,11 @@ class Parser extends Transform {
6457
6457
return 0 ;
6458
6458
}
6459
6459
__error ( msg ) {
6460
- const { skip_lines_with_error} = this . options ;
6460
+ const { encoding , raw , skip_lines_with_error} = this . options ;
6461
6461
const err = typeof msg === 'string' ? new Error ( msg ) : msg ;
6462
6462
if ( skip_lines_with_error ) {
6463
6463
this . state . recordHasError = true ;
6464
- this . emit ( 'skip' , err ) ;
6464
+ this . emit ( 'skip' , err , raw ? this . state . rawBuffer . toString ( encoding ) : undefined ) ;
6465
6465
return undefined ;
6466
6466
} else {
6467
6467
return err ;
@@ -6474,12 +6474,13 @@ class Parser extends Transform {
6474
6474
} ;
6475
6475
}
6476
6476
__infoRecord ( ) {
6477
- const { columns} = this . options ;
6477
+ const { columns, raw , encoding } = this . options ;
6478
6478
return {
6479
6479
...this . __infoDataSet ( ) ,
6480
6480
error : this . state . error ,
6481
6481
header : columns === true ,
6482
6482
index : this . state . record . length ,
6483
+ raw : raw ? this . state . rawBuffer . toString ( encoding ) : undefined
6483
6484
} ;
6484
6485
}
6485
6486
__infoField ( ) {
Original file line number Diff line number Diff line change @@ -6454,11 +6454,11 @@ class Parser extends Transform {
6454
6454
return 0 ;
6455
6455
}
6456
6456
__error ( msg ) {
6457
- const { skip_lines_with_error} = this . options ;
6457
+ const { encoding , raw , skip_lines_with_error} = this . options ;
6458
6458
const err = typeof msg === 'string' ? new Error ( msg ) : msg ;
6459
6459
if ( skip_lines_with_error ) {
6460
6460
this . state . recordHasError = true ;
6461
- this . emit ( 'skip' , err ) ;
6461
+ this . emit ( 'skip' , err , raw ? this . state . rawBuffer . toString ( encoding ) : undefined ) ;
6462
6462
return undefined ;
6463
6463
} else {
6464
6464
return err ;
@@ -6471,12 +6471,13 @@ class Parser extends Transform {
6471
6471
} ;
6472
6472
}
6473
6473
__infoRecord ( ) {
6474
- const { columns} = this . options ;
6474
+ const { columns, raw , encoding } = this . options ;
6475
6475
return {
6476
6476
...this . __infoDataSet ( ) ,
6477
6477
error : this . state . error ,
6478
6478
header : columns === true ,
6479
6479
index : this . state . record . length ,
6480
+ raw : raw ? this . state . rawBuffer . toString ( encoding ) : undefined
6480
6481
} ;
6481
6482
}
6482
6483
__infoField ( ) {
Original file line number Diff line number Diff line change @@ -6460,11 +6460,11 @@ var csv = (function (exports) {
6460
6460
return 0 ;
6461
6461
}
6462
6462
__error ( msg ) {
6463
- const { skip_lines_with_error} = this . options ;
6463
+ const { encoding , raw , skip_lines_with_error} = this . options ;
6464
6464
const err = typeof msg === 'string' ? new Error ( msg ) : msg ;
6465
6465
if ( skip_lines_with_error ) {
6466
6466
this . state . recordHasError = true ;
6467
- this . emit ( 'skip' , err ) ;
6467
+ this . emit ( 'skip' , err , raw ? this . state . rawBuffer . toString ( encoding ) : undefined ) ;
6468
6468
return undefined ;
6469
6469
} else {
6470
6470
return err ;
@@ -6477,12 +6477,13 @@ var csv = (function (exports) {
6477
6477
} ;
6478
6478
}
6479
6479
__infoRecord ( ) {
6480
- const { columns} = this . options ;
6480
+ const { columns, raw , encoding } = this . options ;
6481
6481
return {
6482
6482
...this . __infoDataSet ( ) ,
6483
6483
error : this . state . error ,
6484
6484
header : columns === true ,
6485
6485
index : this . state . record . length ,
6486
+ raw : raw ? this . state . rawBuffer . toString ( encoding ) : undefined
6486
6487
} ;
6487
6488
}
6488
6489
__infoField ( ) {
Original file line number Diff line number Diff line change @@ -6457,11 +6457,11 @@ var csv = (function (exports) {
6457
6457
return 0 ;
6458
6458
}
6459
6459
__error ( msg ) {
6460
- const { skip_lines_with_error} = this . options ;
6460
+ const { encoding , raw , skip_lines_with_error} = this . options ;
6461
6461
const err = typeof msg === 'string' ? new Error ( msg ) : msg ;
6462
6462
if ( skip_lines_with_error ) {
6463
6463
this . state . recordHasError = true ;
6464
- this . emit ( 'skip' , err ) ;
6464
+ this . emit ( 'skip' , err , raw ? this . state . rawBuffer . toString ( encoding ) : undefined ) ;
6465
6465
return undefined ;
6466
6466
} else {
6467
6467
return err ;
@@ -6474,12 +6474,13 @@ var csv = (function (exports) {
6474
6474
} ;
6475
6475
}
6476
6476
__infoRecord ( ) {
6477
- const { columns} = this . options ;
6477
+ const { columns, raw , encoding } = this . options ;
6478
6478
return {
6479
6479
...this . __infoDataSet ( ) ,
6480
6480
error : this . state . error ,
6481
6481
header : columns === true ,
6482
6482
index : this . state . record . length ,
6483
+ raw : raw ? this . state . rawBuffer . toString ( encoding ) : undefined
6483
6484
} ;
6484
6485
}
6485
6486
__infoField ( ) {
Original file line number Diff line number Diff line change 6463
6463
return 0 ;
6464
6464
}
6465
6465
__error ( msg ) {
6466
- const { skip_lines_with_error} = this . options ;
6466
+ const { encoding , raw , skip_lines_with_error} = this . options ;
6467
6467
const err = typeof msg === 'string' ? new Error ( msg ) : msg ;
6468
6468
if ( skip_lines_with_error ) {
6469
6469
this . state . recordHasError = true ;
6470
- this . emit ( 'skip' , err ) ;
6470
+ this . emit ( 'skip' , err , raw ? this . state . rawBuffer . toString ( encoding ) : undefined ) ;
6471
6471
return undefined ;
6472
6472
} else {
6473
6473
return err ;
6480
6480
} ;
6481
6481
}
6482
6482
__infoRecord ( ) {
6483
- const { columns} = this . options ;
6483
+ const { columns, raw , encoding } = this . options ;
6484
6484
return {
6485
6485
...this . __infoDataSet ( ) ,
6486
6486
error : this . state . error ,
6487
6487
header : columns === true ,
6488
6488
index : this . state . record . length ,
6489
+ raw : raw ? this . state . rawBuffer . toString ( encoding ) : undefined
6489
6490
} ;
6490
6491
}
6491
6492
__infoField ( ) {
Original file line number Diff line number Diff line change 6460
6460
return 0 ;
6461
6461
}
6462
6462
__error ( msg ) {
6463
- const { skip_lines_with_error} = this . options ;
6463
+ const { encoding , raw , skip_lines_with_error} = this . options ;
6464
6464
const err = typeof msg === 'string' ? new Error ( msg ) : msg ;
6465
6465
if ( skip_lines_with_error ) {
6466
6466
this . state . recordHasError = true ;
6467
- this . emit ( 'skip' , err ) ;
6467
+ this . emit ( 'skip' , err , raw ? this . state . rawBuffer . toString ( encoding ) : undefined ) ;
6468
6468
return undefined ;
6469
6469
} else {
6470
6470
return err ;
6477
6477
} ;
6478
6478
}
6479
6479
__infoRecord ( ) {
6480
- const { columns} = this . options ;
6480
+ const { columns, raw , encoding } = this . options ;
6481
6481
return {
6482
6482
...this . __infoDataSet ( ) ,
6483
6483
error : this . state . error ,
6484
6484
header : columns === true ,
6485
6485
index : this . state . record . length ,
6486
+ raw : raw ? this . state . rawBuffer . toString ( encoding ) : undefined
6486
6487
} ;
6487
6488
}
6488
6489
__infoField ( ) {
You can’t perform that action at this time.
0 commit comments