MCPcopy
hub / github.com/webpack/webpack / merge

Method merge

lib/ConditionalInitFragment.js:106–123  ·  view source on GitHub ↗

* Returns merged fragment. * @param {ConditionalInitFragment} other fragment to merge with * @returns {ConditionalInitFragment} merged fragment

(other)

Source from the content-addressed store, hash-verified

104 * @returns {ConditionalInitFragment} merged fragment
105 */
106 merge(other) {
107 if (this.runtimeCondition === true) return this;
108 if (other.runtimeCondition === true) return other;
109 if (this.runtimeCondition === false) return other;
110 if (other.runtimeCondition === false) return this;
111 const runtimeCondition = mergeRuntime(
112 this.runtimeCondition,
113 other.runtimeCondition
114 );
115 return new ConditionalInitFragment(
116 this.content,
117 this.stage,
118 this.position,
119 this.key,
120 runtimeCondition,
121 this.endContent
122 );
123 }
124}
125
126module.exports = ConditionalInitFragment;

Callers 1

addToSourceMethod · 0.45

Calls 1

mergeRuntimeFunction · 0.85

Tested by

no test coverage detected