(expr: BoxedExpression, op: string)
| 123 | if (!e.ops) return 1; |
| 124 | return 1 + e.ops.reduce((s, op) => s + leafCount(op), 0); |
| 125 | } |
| 126 | |
| 127 | function containsOperator(expr: BoxedExpression, op: string): boolean { |
| 128 | if (expr.operator === op) return true; |
| 129 | if (expr.ops) return expr.ops.some((x) => containsOperator(x, op)); |
| 130 | return false; |
| 131 | } |
| 132 |