(
op: 'and' | 'or',
exprOption: LogicalExpressionOption,
getters: ConditionalGetters
)
| 332 | } |
| 333 | |
| 334 | function parseAndOrOption( |
| 335 | op: 'and' | 'or', |
| 336 | exprOption: LogicalExpressionOption, |
| 337 | getters: ConditionalGetters |
| 338 | ): ParsedConditionInternal { |
| 339 | const subOptionArr = exprOption[op] as ConditionalExpressionOption[]; |
| 340 | let errMsg = ''; |
| 341 | if (__DEV__) { |
| 342 | errMsg = makePrintable( |
| 343 | '"and"/"or" condition should only be `' + op + ': [...]` and must not be empty array.', |
| 344 | 'Illegal condition:', exprOption |
| 345 | ); |
| 346 | } |
| 347 | if (!isArray(subOptionArr)) { |
| 348 | throwError(errMsg); |
| 349 | } |
| 350 | if (!(subOptionArr as []).length) { |
| 351 | throwError(errMsg); |
| 352 | } |
| 353 | const cond = op === 'and' ? new AndConditionInternal() : new OrConditionInternal(); |
| 354 | cond.children = map(subOptionArr, subOption => parseOption(subOption, getters)); |
| 355 | if (!cond.children.length) { |
| 356 | throwError(errMsg); |
| 357 | } |
| 358 | return cond; |
| 359 | } |
| 360 | |
| 361 | function parseNotOption( |
| 362 | exprOption: LogicalExpressionOption, |
no test coverage detected
searching dependent graphs…