Function
invertSearchExpressionGroup
(input: SearchExpressionGroup)
Source from the content-addressed store, hash-verified
| 10 | } from './types'; |
| 11 | |
| 12 | function invertSearchExpressionGroup(input: SearchExpressionGroup) { |
| 13 | //this only works if all expressions in this group have the same clause |
| 14 | const output: SearchExpressionGroup = { |
| 15 | expressions: input.expressions.map(invertSearchExpression), |
| 16 | }; |
| 17 | if (input.clause) { |
| 18 | output.clause = invertedClauses[input.clause]; |
| 19 | } |
| 20 | return output; |
| 21 | } |
| 22 | |
| 23 | const invertedOperators: { [key in SearchExpressionOperators]: SearchExpressionOperators } = { |
| 24 | '!=': '==', |
Tested by
no test coverage detected