csv-parse
Advanced tools
Comparing version 5.5.5 to 5.5.6
@@ -273,2 +273,9 @@ | ||
} | ||
// Normalize option `on_skip` | ||
// options.on_skip ??= (err, chunk) => { | ||
// this.emit('skip', err, chunk); | ||
// }; | ||
if(options.on_skip !== undefined && options.on_skip !== null && typeof options.on_skip !== 'function'){ | ||
throw new Error(`Invalid Option: on_skip must be a function, got ${JSON.stringify(options.on_skip)}`); | ||
} | ||
// Normalize option `quote` | ||
@@ -275,0 +282,0 @@ if(options.quote === null || options.quote === false || options.quote === ''){ |
@@ -17,6 +17,5 @@ | ||
super({...{readableObjectMode: true}, ...opts, encoding: null}); | ||
this.api = transform(opts); | ||
this.api.options.on_skip = (err, chunk) => { | ||
this.api = transform({on_skip: (err, chunk) => { | ||
this.emit('skip', err, chunk); | ||
}; | ||
}, ...opts}); | ||
// Backward compatibility | ||
@@ -23,0 +22,0 @@ this.state = this.api.state; |
{ | ||
"version": "5.5.5", | ||
"version": "5.5.6", | ||
"name": "csv-parse", | ||
@@ -71,3 +71,3 @@ "description": "CSV parsing implementing the Node.js `stream.Transform` API", | ||
"coffeescript": "^2.7.0", | ||
"csv-generate": "^4.4.0", | ||
"csv-generate": "^4.4.1", | ||
"csv-spectrum": "^1.0.0", | ||
@@ -82,3 +82,3 @@ "each": "^2.4.0", | ||
"should": "^13.2.3", | ||
"stream-transform": "^3.3.1", | ||
"stream-transform": "^3.3.2", | ||
"ts-node": "^10.9.1", | ||
@@ -143,3 +143,3 @@ "typescript": "^5.2.2" | ||
}, | ||
"gitHead": "410e7b172ce19e975825fcc95dbcfc0340f75af2" | ||
"gitHead": "6aadcace1a9e77ea308159733391e42ad019c5cb" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1406503
32613