* Apply a single stateful sync transform to a source.
(source, transform)
| 527 | * Apply a single stateful sync transform to a source. |
| 528 | */ |
| 529 | function applyStatefulSyncTransform(source, transform) { |
| 530 | var output, _i, output_1, item, batch, _a, _b, chunk; |
| 531 | return __generator(this, function (_c) { |
| 532 | switch (_c.label) { |
| 533 | case 0: |
| 534 | output = transform(source); |
| 535 | _i = 0, output_1 = output; |
| 536 | _c.label = 1; |
| 537 | case 1: |
| 538 | if (!(_i < output_1.length)) return [3 /*break*/, 4]; |
| 539 | item = output_1[_i]; |
| 540 | batch = []; |
| 541 | for (_a = 0, _b = flattenTransformYieldSync(item); _a < _b.length; _a++) { |
| 542 | chunk = _b[_a]; |
| 543 | batch.push(chunk); |
| 544 | } |
| 545 | if (!(batch.length > 0)) return [3 /*break*/, 3]; |
| 546 | return [4 /*yield*/, batch]; |
| 547 | case 2: |
| 548 | _c.sent(); |
| 549 | _c.label = 3; |
| 550 | case 3: |
| 551 | _i++; |
| 552 | return [3 /*break*/, 1]; |
| 553 | case 4: return [2 /*return*/]; |
| 554 | } |
| 555 | }); |
| 556 | } |
| 557 | /** |
| 558 | * Wrap sync source to add null flush signal at end. |
| 559 | */ |
no test coverage detected