| 275 | } |
| 276 | } |
| 277 | class RelationalConditionInternal implements ParsedConditionInternal { |
| 278 | valueGetterParam: ValueGetterParam; |
| 279 | valueParser: ReturnType<typeof getRawValueParser>; |
| 280 | // If no parser, be null/undefined. |
| 281 | getValue: ConditionalExpressionValueGetter; |
| 282 | subCondList: FilterComparator[]; |
| 283 | |
| 284 | evaluate() { |
| 285 | const needParse = !!this.valueParser; |
| 286 | // Call getValue with no `this`. |
| 287 | const getValue = this.getValue; |
| 288 | const tarValRaw = getValue(this.valueGetterParam); |
| 289 | const tarValParsed = needParse ? this.valueParser(tarValRaw) : null; |
| 290 | |
| 291 | // Relational cond follow "and" logic internally. |
| 292 | for (let i = 0; i < this.subCondList.length; i++) { |
| 293 | if (!this.subCondList[i].evaluate(needParse ? tarValParsed : tarValRaw)) { |
| 294 | return false; |
| 295 | } |
| 296 | } |
| 297 | return true; |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | function parseOption( |
| 302 | exprOption: ConditionalExpressionOption, |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…