MCPcopy
hub / github.com/rollup/rollup / getVariableForExportName

Method getVariableForExportName

src/ExternalModule.ts:70–84  ·  view source on GitHub ↗
(
		name: string,
		{ importChain }: { importChain: string[] }
	)

Source from the content-addressed store, hash-verified

68 }
69
70 getVariableForExportName(
71 name: string,
72 { importChain }: { importChain: string[] }
73 ): [variable: ExternalVariable] {
74 const declaration = this.declarations.get(name);
75 for (const module of importChain) {
76 getOrCreate(this.importersByExportedName, name, getNewSet).add(module);
77 }
78 if (declaration) return [declaration];
79 const externalVariable = new ExternalVariable(this, name);
80
81 this.declarations.set(name, externalVariable);
82 this.exportedVariables.set(externalVariable, name);
83 return [externalVariable];
84 }
85
86 suggestName(name: string): void {
87 const value = (this.nameSuggestions.get(name) ?? 0) + 1;

Callers

nothing calls this directly

Calls 4

getOrCreateFunction · 0.90
getMethod · 0.80
addMethod · 0.80
setMethod · 0.65

Tested by

no test coverage detected