node-automator 1.3.11 → 1.3.12
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/commands/share_data.js +9 -0
- package/package.json +1 -1
package/commands/share_data.js
CHANGED
|
@@ -504,6 +504,15 @@ function processPipe(val, pipename, pipeargs) {
|
|
|
504
504
|
val = val.map(v => v[pipeargs[0]]);
|
|
505
505
|
break;
|
|
506
506
|
}
|
|
507
|
+
case "chunk": {
|
|
508
|
+
var ret = [];
|
|
509
|
+
var chunkSize = pipeargs[0] || 50;
|
|
510
|
+
for (var i = 0, chunkNum = Math.ceil(val.length / chunkSize); i < chunkNum; i++) {
|
|
511
|
+
ret.push(val.slice(i * chunkSize, (i + 1) * chunkSize));
|
|
512
|
+
}
|
|
513
|
+
val = ret;
|
|
514
|
+
break;
|
|
515
|
+
}
|
|
507
516
|
case "size": {
|
|
508
517
|
if (!val) {
|
|
509
518
|
val = 0;
|