MCPcopy
hub / github.com/webpack/webpack / combineConditionsOr

Method combineConditionsOr

lib/rules/RuleSetCompiler.js:417–430  ·  view source on GitHub ↗

* Combine conditions or. * @param {Condition[]} conditions some conditions * @returns {Condition} merged condition

(conditions)

Source from the content-addressed store, hash-verified

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.

Callers 1

compileConditionMethod · 0.95

Calls 1

fnMethod · 0.45

Tested by

no test coverage detected