(
name: string,
{
importerForSideEffects,
importChain = [],
isExportAllSearch,
onlyExplicit,
searchedNamesAndModules,
sideEffectModules,
exportOrReexportModules
}: {
importerForSideEffects?: Module;
importChain?: string[];
isExportAllSearch?: boolean;
onlyExplicit?: boolean;
searchedNamesAndModules?: Map<string, Set<Module | ExternalModule>>;
sideEffectModules?: Set<Module>;
exportOrReexportModules?: Set<Module>;
} = EMPTY_OBJECT
)
| 596 | } |
| 597 | |
| 598 | getVariableForExportName( |
| 599 | name: string, |
| 600 | { |
| 601 | importerForSideEffects, |
| 602 | importChain = [], |
| 603 | isExportAllSearch, |
| 604 | onlyExplicit, |
| 605 | searchedNamesAndModules, |
| 606 | sideEffectModules, |
| 607 | exportOrReexportModules |
| 608 | }: { |
| 609 | importerForSideEffects?: Module; |
| 610 | importChain?: string[]; |
| 611 | isExportAllSearch?: boolean; |
| 612 | onlyExplicit?: boolean; |
| 613 | searchedNamesAndModules?: Map<string, Set<Module | ExternalModule>>; |
| 614 | sideEffectModules?: Set<Module>; |
| 615 | exportOrReexportModules?: Set<Module>; |
| 616 | } = EMPTY_OBJECT |
| 617 | ): [variable: Variable | null, options?: VariableOptions] { |
| 618 | if (name[0] === '*') { |
| 619 | if (name.length === 1) { |
| 620 | // export * from './other' |
| 621 | return [this.namespace]; |
| 622 | } |
| 623 | // export * from 'external' |
| 624 | const module = this.graph.modulesById.get(name.slice(1)) as ExternalModule; |
| 625 | return module.getVariableForExportName('*', { |
| 626 | importChain: [...importChain, this.id] |
| 627 | }); |
| 628 | } |
| 629 | |
| 630 | // export { foo } from './other' |
| 631 | const reexportDeclaration = this.reexportDescriptions.get(name); |
| 632 | if (reexportDeclaration) { |
| 633 | const [variable, options] = getVariableForExportNameRecursive( |
| 634 | reexportDeclaration.module, |
| 635 | reexportDeclaration.localName, |
| 636 | importerForSideEffects, |
| 637 | false, |
| 638 | searchedNamesAndModules, |
| 639 | [...importChain, this.id], |
| 640 | sideEffectModules, |
| 641 | exportOrReexportModules |
| 642 | ); |
| 643 | if (!variable) { |
| 644 | return this.error( |
| 645 | logMissingExport( |
| 646 | reexportDeclaration.localName, |
| 647 | this.id, |
| 648 | reexportDeclaration.module.id, |
| 649 | !!options?.missingButExportExists |
| 650 | ), |
| 651 | reexportDeclaration.start |
| 652 | ); |
| 653 | } |
| 654 | if (importerForSideEffects) { |
| 655 | setAlternativeExporterIfCyclic(variable, importerForSideEffects, this); |
no test coverage detected