MCPcopy
hub / github.com/webpack/webpack / isEquallyUsed

Method isEquallyUsed

lib/ExportsInfo.js:751–772  ·  view source on GitHub ↗

* Checks whether this exports info is equally used. * @param {RuntimeSpec} runtimeA first runtime * @param {RuntimeSpec} runtimeB second runtime * @returns {boolean} true, when equally used

(runtimeA, runtimeB)

Source from the content-addressed store, hash-verified

749 * @returns {boolean} true, when equally used
750 */
751 isEquallyUsed(runtimeA, runtimeB) {
752 if (this._redirectTo !== undefined) {
753 if (!this._redirectTo.isEquallyUsed(runtimeA, runtimeB)) return false;
754 } else if (
755 this._otherExportsInfo.getUsed(runtimeA) !==
756 this._otherExportsInfo.getUsed(runtimeB)
757 ) {
758 return false;
759 }
760 if (
761 this._sideEffectsOnlyInfo.getUsed(runtimeA) !==
762 this._sideEffectsOnlyInfo.getUsed(runtimeB)
763 ) {
764 return false;
765 }
766 for (const exportInfo of this.ownedExports) {
767 if (exportInfo.getUsed(runtimeA) !== exportInfo.getUsed(runtimeB)) {
768 return false;
769 }
770 }
771 return true;
772 }
773
774 /**
775 * Returns usage status.

Callers 1

applyMethod · 0.80

Calls 1

getUsedMethod · 0.45

Tested by

no test coverage detected