(
exprOption: ConditionalExpressionOption,
getters: ConditionalGetters
)
| 299 | } |
| 300 | |
| 301 | function parseOption( |
| 302 | exprOption: ConditionalExpressionOption, |
| 303 | getters: ConditionalGetters |
| 304 | ): ParsedConditionInternal { |
| 305 | if (exprOption === true || exprOption === false) { |
| 306 | const cond = new ConstConditionInternal(); |
| 307 | cond.value = exprOption as boolean; |
| 308 | return cond; |
| 309 | } |
| 310 | |
| 311 | let errMsg = ''; |
| 312 | if (!isObjectNotArray(exprOption)) { |
| 313 | if (__DEV__) { |
| 314 | errMsg = makePrintable( |
| 315 | 'Illegal config. Expect a plain object but actually', exprOption |
| 316 | ); |
| 317 | } |
| 318 | throwError(errMsg); |
| 319 | } |
| 320 | |
| 321 | if ((exprOption as LogicalExpressionOption).and) { |
| 322 | return parseAndOrOption('and', exprOption as LogicalExpressionOption, getters); |
| 323 | } |
| 324 | else if ((exprOption as LogicalExpressionOption).or) { |
| 325 | return parseAndOrOption('or', exprOption as LogicalExpressionOption, getters); |
| 326 | } |
| 327 | else if ((exprOption as LogicalExpressionOption).not) { |
| 328 | return parseNotOption(exprOption as LogicalExpressionOption, getters); |
| 329 | } |
| 330 | |
| 331 | return parseRelationalOption(exprOption as RelationalExpressionOption, getters); |
| 332 | } |
| 333 | |
| 334 | function parseAndOrOption( |
| 335 | op: 'and' | 'or', |
no test coverage detected
searching dependent graphs…