@carbonorm/carbonnode 3.9.6 → 3.10.0

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.
@@ -545,8 +545,18 @@ export abstract class ConditionBuilder<
545
545
  if (Array.isArray(node)) {
546
546
  if (node.length === 0) return '';
547
547
 
548
+ // Support both [left, operator, right] and [operator, left, right]
548
549
  if (node.length === 3 && typeof node[0] === 'string' && typeof node[1] === 'string') {
549
- return this.buildOperatorExpression(node[1], [node[0], node[2]], params, node[0]);
550
+ const opAsSecond = this.isOperator(node[1]);
551
+ const opAsFirst = this.isOperator(node[0]);
552
+
553
+ if (opAsSecond) {
554
+ return this.buildOperatorExpression(node[1], [node[0], node[2]], params, node[0]);
555
+ }
556
+ if (opAsFirst) {
557
+ return this.buildOperatorExpression(node[0], [node[1], node[2]], params, node[1]);
558
+ }
559
+ // fall-through to treat as grouped expressions
550
560
  }
551
561
 
552
562
  const parts = node