From a0026683f7b8ebeda9e54da9b9825b2d41058480 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Wed, 14 Nov 2018 11:59:02 +0100 Subject: [PATCH] Return data directly on NodeStream as step function now returns a single row --- papaparse.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/papaparse.js b/papaparse.js index 8676056..9d1fcc6 100755 --- a/papaparse.js +++ b/papaparse.js @@ -898,13 +898,11 @@ if (!Array.isArray) this._onCsvData = function(results) { var data = results.data; - for (var i = 0; i < data.length; i++) { - if (!stream.push(data[i]) && !this._handle.paused()) { - // the writeable consumer buffer has filled up - // so we need to pause until more items - // can be processed - this._handle.pause(); - } + if (!stream.push(data) && !this._handle.paused()) { + // the writeable consumer buffer has filled up + // so we need to pause until more items + // can be processed + this._handle.pause(); } };