@mondaydotcomorg/atp-compiler 0.19.21 → 0.19.22

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/dist/index.js CHANGED
@@ -481,6 +481,21 @@ var BatchOptimizer = class {
481
481
  reason: "Simple conditional - can batch but consider array size"
482
482
  };
483
483
  }
484
+ const lastStmt = statements[statements.length - 1];
485
+ if (t7.isReturnStatement(lastStmt) && lastStmt.argument) {
486
+ if (t7.isObjectExpression(lastStmt.argument)) {
487
+ return {
488
+ canBatch: false,
489
+ reason: "Return statement is object expression - batch would lose structure"
490
+ };
491
+ }
492
+ if (t7.isArrayExpression(lastStmt.argument)) {
493
+ return {
494
+ canBatch: false,
495
+ reason: "Return statement is array expression - batch would lose structure"
496
+ };
497
+ }
498
+ }
484
499
  return {
485
500
  canBatch: true,
486
501
  llmCallPattern: "single",