PapaParse
PapaParse copied to clipboard
feat: support for full result object in node streams
Why these changes
When using the DuplexStreamStreamer in node, the callback only receives the row data, instead of the full parse result object, however the library still generates per-row errors (if any) and metadata internally, which are useful when processing. For example, it would be helpful to be able to validate meta.renamedHeaders
or check that errors
is empty for the given row.
What does this PR change
Adds an optional configuration setting to provide the full result object to the callback (and corresponding tests). This allows PapaParse users to opt-in, since changing default behavior would be breaking. As with existing behavior when using streams, the result object (including both the error
array and meta
object) are atomic to the individual row sent to the callback.
Resolves #754