@vbarbarosh/node-helpers 3.15.0 → 3.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/stream_group.js +2 -2
package/package.json
CHANGED
package/src/stream_group.js
CHANGED
|
@@ -8,7 +8,7 @@ function stream_group(chunk_size)
|
|
|
8
8
|
const chunk = [];
|
|
9
9
|
return new stream.Transform({
|
|
10
10
|
objectMode: true,
|
|
11
|
-
transform: function (item,
|
|
11
|
+
transform: function (item, encoding, next) {
|
|
12
12
|
chunk.push(item);
|
|
13
13
|
if (chunk.length >= chunk_size) {
|
|
14
14
|
this.push(chunk.splice(0));
|
|
@@ -18,8 +18,8 @@ function stream_group(chunk_size)
|
|
|
18
18
|
flush: function (next) {
|
|
19
19
|
if (chunk.length) {
|
|
20
20
|
this.push(chunk.splice(0));
|
|
21
|
-
next();
|
|
22
21
|
}
|
|
22
|
+
next();
|
|
23
23
|
},
|
|
24
24
|
});
|
|
25
25
|
}
|