MCPcopy
hub / github.com/webpack/webpack / nameForCondition

Method nameForCondition

lib/NormalModule.js:990–995  ·  view source on GitHub ↗

* Returns the path used when matching this module against rule conditions. * @returns {NameForCondition | null} absolute path which should be used for condition matching (usually the resource path)

()

Source from the content-addressed store, hash-verified

988 * @returns {NameForCondition | null} absolute path which should be used for condition matching (usually the resource path)
989 */
990 nameForCondition() {
991 const resource = /** @type {string} */ (this.getResource());
992 const idx = resource.indexOf("?");
993 if (idx >= 0) return resource.slice(0, idx);
994 return resource;
995 }
996
997 /**
998 * Assuming this module is in the cache. Update the (cached) module with

Callers

nothing calls this directly

Calls 2

getResourceMethod · 0.95
sliceMethod · 0.80

Tested by

no test coverage detected