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.
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-automator",
3
- "version": "1.3.11",
3
+ "version": "1.3.12",
4
4
  "description": "Execute automation with yaml configuration(compatible with json)",
5
5
  "main": "index.js",
6
6
  "repository": {