MCPcopy
hub / github.com/webpack/webpack / isUsed

Method isUsed

lib/ExportsInfo.js:555–569  ·  lib/ExportsInfo.js::ExportsInfo.isUsed

* Checks whether this exports info is used. * @param {RuntimeSpec} runtime the runtime * @returns {boolean} true, when the module exports are used in any way

(runtime)

Source from the content-addressed store, hash-verified

553 * @returns {boolean} true, when the module exports are used in any way
554 */
555 isUsed(runtime) {
556 if (this._redirectTo !== undefined) {
557 if (this._redirectTo.isUsed(runtime)) {
558 return true;
559 }
560 } else if (this._otherExportsInfo.getUsed(runtime) !== UsageState.Unused) {
561 return true;
562 }
563 for (const exportInfo of this._exports.values()) {
564 if (exportInfo.getUsed(runtime) !== UsageState.Unused) {
565 return true;
566 }
567 }
568 return false;
569 }
570
571 /**
572 * Checks whether this exports info is module used.

Callers 9

isModuleUsedMethod · 0.95
getUsedNameMethod · 0.95
applyMethod · 0.80
emitRecordsMethod · 0.80
readRecordsMethod · 0.80
applyMethod · 0.80
applyMethod · 0.80
getModeFunction · 0.80

Calls 2

getUsedMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected