* Combine conditions or. * @param {Condition[]} conditions some conditions * @returns {Condition} merged condition
(conditions)
| 415 | * @returns {Condition} merged condition |
| 416 | */ |
| 417 | combineConditionsOr(conditions) { |
| 418 | if (conditions.length === 0) { |
| 419 | return { |
| 420 | matchWhenEmpty: false, |
| 421 | fn: () => false |
| 422 | }; |
| 423 | } else if (conditions.length === 1) { |
| 424 | return conditions[0]; |
| 425 | } |
| 426 | return { |
| 427 | matchWhenEmpty: conditions.some((c) => c.matchWhenEmpty), |
| 428 | fn: (v) => conditions.some((c) => c.fn(v)) |
| 429 | }; |
| 430 | } |
| 431 | |
| 432 | /** |
| 433 | * Combine conditions and. |