(expr: Expression, ...ops: string[])
| 41 | * Check if expression contains specific operators anywhere in the tree |
| 42 | */ |
| 43 | export function hasOperator(expr: Expression, ...ops: string[]): boolean { |
| 44 | if (ops.includes(expr.operator)) return true; |
| 45 | if (!isFunction(expr)) return false; |
| 46 | return expr.ops.some((x) => hasOperator(x, ...ops)); |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * Apply a transformation function to all subexpressions (bottom-up) |
no test coverage detected