MCPcopy
hub / github.com/webpack/webpack / has

Method has

lib/CodeGenerationResults.js:94–106  ·  view source on GitHub ↗

* Reports whether a module has a stored result for the requested runtime, or * a single unambiguous result when no runtime is specified. * @param {Module} module the module * @param {RuntimeSpec} runtime runtime(s) * @returns {boolean} true, when we have data for this

(module, runtime)

Source from the content-addressed store, hash-verified

92 * @returns {boolean} true, when we have data for this
93 */
94 has(module, runtime) {
95 const entry = this.map.get(module);
96 if (entry === undefined) {
97 return false;
98 }
99 if (runtime !== undefined) {
100 return entry.has(runtime);
101 } else if (entry.size > 1) {
102 const results = new Set(entry.values());
103 return results.size === 1;
104 }
105 return entry.size === 1;
106 }
107
108 /**
109 * Returns a generated source of the requested source type from a stored code

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected