@mondaydotcomorg/atp-compiler 0.19.20 → 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.cjs CHANGED
@@ -507,6 +507,21 @@ var BatchOptimizer = class {
507
507
  reason: "Simple conditional - can batch but consider array size"
508
508
  };
509
509
  }
510
+ const lastStmt = statements[statements.length - 1];
511
+ if (t7__namespace.isReturnStatement(lastStmt) && lastStmt.argument) {
512
+ if (t7__namespace.isObjectExpression(lastStmt.argument)) {
513
+ return {
514
+ canBatch: false,
515
+ reason: "Return statement is object expression - batch would lose structure"
516
+ };
517
+ }
518
+ if (t7__namespace.isArrayExpression(lastStmt.argument)) {
519
+ return {
520
+ canBatch: false,
521
+ reason: "Return statement is array expression - batch would lose structure"
522
+ };
523
+ }
524
+ }
510
525
  return {
511
526
  canBatch: true,
512
527
  llmCallPattern: "single",