MCPcopy
hub / github.com/webpack/webpack / getTerminalBinding

Method getTerminalBinding

lib/ExportsInfo.js:1535–1542  ·  view source on GitHub ↗

* Gets terminal binding. * @param {ModuleGraph} moduleGraph the module graph * @param {ResolveTargetFilter} resolveTargetFilter filter function to further resolve target * @returns {ExportInfo | ExportsInfo | undefined} the terminal binding export(s) info if known

(moduleGraph, resolveTargetFilter = RETURNS_TRUE)

Source from the content-addressed store, hash-verified

1533 * @returns {ExportInfo | ExportsInfo | undefined} the terminal binding export(s) info if known
1534 */
1535 getTerminalBinding(moduleGraph, resolveTargetFilter = RETURNS_TRUE) {
1536 if (this.terminalBinding) return this;
1537 const target = this.getTarget(moduleGraph, resolveTargetFilter);
1538 if (!target) return;
1539 const exportsInfo = moduleGraph.getExportsInfo(target.module);
1540 if (!target.export) return exportsInfo;
1541 return exportsInfo.getReadOnlyExportInfoRecursive(target.export);
1542 }
1543
1544 isReexport() {
1545 return !this.terminalBinding && this._target && this._target.size > 0;

Callers 1

_getErrorsMethod · 0.80

Calls 3

getTargetMethod · 0.95
getExportsInfoMethod · 0.80

Tested by

no test coverage detected