MCPcopy
hub / github.com/webpack/webpack / combineConditionsAnd

Method combineConditionsAnd

lib/rules/RuleSetCompiler.js:437–450  ·  view source on GitHub ↗

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

(conditions)

Source from the content-addressed store, hash-verified

435 * @returns {Condition} merged condition
436 */
437 combineConditionsAnd(conditions) {
438 if (conditions.length === 0) {
439 return {
440 matchWhenEmpty: false,
441 fn: () => false
442 };
443 } else if (conditions.length === 1) {
444 return conditions[0];
445 }
446 return {
447 matchWhenEmpty: conditions.every((c) => c.matchWhenEmpty),
448 fn: (v) => conditions.every((c) => c.fn(v))
449 };
450 }
451
452 /**
453 * Returns an error object.

Callers 1

compileConditionMethod · 0.95

Calls 1

fnMethod · 0.45

Tested by

no test coverage detected