csv-parse
Advanced tools
Comparing version 4.8.5 to 4.8.6
@@ -13,2 +13,6 @@ | ||
## Version 4.8.6 | ||
* on_record: catch and handle user errors | ||
## Version 4.8.5 | ||
@@ -15,0 +19,0 @@ |
@@ -872,3 +872,3 @@ "use strict"; | ||
if (raw === true || info === true) { | ||
this.__push(Object.assign({ | ||
var _err6 = this.__push(Object.assign({ | ||
record: obj | ||
@@ -880,8 +880,16 @@ }, raw === true ? { | ||
} : {})); | ||
if (_err6) { | ||
return _err6; | ||
} | ||
} else { | ||
this.__push(obj); | ||
var _err7 = this.__push(obj); | ||
if (_err7) { | ||
return _err7; | ||
} | ||
} | ||
} else { | ||
if (raw === true || info === true) { | ||
this.__push(Object.assign({ | ||
var _err8 = this.__push(Object.assign({ | ||
record: [obj[objname], obj] | ||
@@ -893,4 +901,12 @@ }, raw === true ? { | ||
} : {})); | ||
if (_err8) { | ||
return _err8; | ||
} | ||
} else { | ||
this.__push([obj[objname], obj]); | ||
var _err9 = this.__push([obj[objname], obj]); | ||
if (_err9) { | ||
return _err9; | ||
} | ||
} | ||
@@ -900,3 +916,3 @@ } | ||
if (raw === true || info === true) { | ||
this.__push(Object.assign({ | ||
var _err10 = this.__push(Object.assign({ | ||
record: record | ||
@@ -908,4 +924,12 @@ }, raw === true ? { | ||
} : {})); | ||
if (_err10) { | ||
return _err10; | ||
} | ||
} else { | ||
this.__push(record); | ||
var _err11 = this.__push(record); | ||
if (_err11) { | ||
return _err11; | ||
} | ||
} | ||
@@ -1006,3 +1030,7 @@ } | ||
record = on_record.call(null, record, context); | ||
try { | ||
record = on_record.call(null, record, context); | ||
} catch (err) { | ||
return err; | ||
} | ||
@@ -1009,0 +1037,0 @@ if (record === undefined || record === null) { |
@@ -736,3 +736,3 @@ | ||
if(raw === true || info === true){ | ||
this.__push(Object.assign( | ||
const err = this.__push(Object.assign( | ||
{record: obj}, | ||
@@ -742,8 +742,14 @@ (raw === true ? {raw: this.state.rawBuffer.toString()}: {}), | ||
)) | ||
if(err){ | ||
return err | ||
} | ||
}else{ | ||
this.__push(obj) | ||
const err = this.__push(obj) | ||
if(err){ | ||
return err | ||
} | ||
} | ||
}else{ | ||
if(raw === true || info === true){ | ||
this.__push(Object.assign( | ||
const err = this.__push(Object.assign( | ||
{record: [obj[objname], obj]}, | ||
@@ -753,4 +759,10 @@ raw === true ? {raw: this.state.rawBuffer.toString()}: {}, | ||
)) | ||
if(err){ | ||
return err | ||
} | ||
}else{ | ||
this.__push([obj[objname], obj]) | ||
const err = this.__push([obj[objname], obj]) | ||
if(err){ | ||
return err | ||
} | ||
} | ||
@@ -760,3 +772,3 @@ } | ||
if(raw === true || info === true){ | ||
this.__push(Object.assign( | ||
const err = this.__push(Object.assign( | ||
{record: record}, | ||
@@ -766,4 +778,10 @@ raw === true ? {raw: this.state.rawBuffer.toString()}: {}, | ||
)) | ||
if(err){ | ||
return err | ||
} | ||
}else{ | ||
this.__push(record) | ||
const err = this.__push(record) | ||
if(err){ | ||
return err | ||
} | ||
} | ||
@@ -836,3 +854,7 @@ } | ||
const context = this.__context() | ||
record = on_record.call(null, record, context) | ||
try{ | ||
record = on_record.call(null, record, context) | ||
}catch(err){ | ||
return err | ||
} | ||
if(record === undefined || record === null){ return } | ||
@@ -839,0 +861,0 @@ } |
{ | ||
"version": "4.8.5", | ||
"version": "4.8.6", | ||
"name": "csv-parse", | ||
@@ -4,0 +4,0 @@ "description": "CSV parsing implementing the Node.js `stream.Transform` API", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
131713
2718