MCPcopy
hub / github.com/webpack/webpack / isExportProvided

Method isExportProvided

lib/ExportsInfo.js:707–723  ·  view source on GitHub ↗

* Checks whether this exports info is export provided. * @param {ExportInfoName | ExportInfoName[]} name the name of the export * @returns {boolean | undefined | null} if the export is provided

(name)

Source from the content-addressed store, hash-verified

705 * @returns {boolean | undefined | null} if the export is provided
706 */
707 isExportProvided(name) {
708 if (Array.isArray(name)) {
709 /** @type {ExportsInfo} */
710 let exportsInfo = this;
711 const last = name.length - 1;
712 for (let i = 0; ; i++) {
713 const info = exportsInfo.getReadOnlyExportInfo(name[i]);
714 if (info.exportsInfo && i < last) {
715 exportsInfo = info.exportsInfo;
716 continue;
717 }
718 return info.provided ? i === last || undefined : info.provided;
719 }
720 }
721 const info = this.getReadOnlyExportInfo(name);
722 return info.provided;
723 }
724
725 /**
726 * Returns key representing the usage.

Callers

nothing calls this directly

Calls 2

getReadOnlyExportInfoMethod · 0.95
isArrayMethod · 0.80

Tested by

no test coverage detected