* Extract all individual conditions from a predicate, flattening AND operations.
( predicate: BasicExpression<boolean>, )
| 946 | * Extract all individual conditions from a predicate, flattening AND operations. |
| 947 | */ |
| 948 | function extractAllConditions( |
| 949 | predicate: BasicExpression<boolean>, |
| 950 | ): Array<BasicExpression<boolean>> { |
| 951 | if (predicate.type === `func` && predicate.name === `and`) { |
| 952 | const conditions: Array<BasicExpression<boolean>> = [] |
| 953 | for (const arg of predicate.args) { |
| 954 | conditions.push(...extractAllConditions(arg as BasicExpression<boolean>)) |
| 955 | } |
| 956 | return conditions |
| 957 | } |
| 958 | |
| 959 | return [predicate] |
| 960 | } |
| 961 | |
| 962 | /** |
| 963 | * Remove specified conditions from a predicate. |
no outgoing calls
no test coverage detected