MCPcopy Create free account
hub / github.com/nodejs/node / isExportSpecifierAlias

Function isExportSpecifierAlias

test/fixtures/snapshot/typescript.js:138278–138290  ·  view source on GitHub ↗
(referenceLocation, exportSpecifier)

Source from the content-addressed store, hash-verified

138276 return isExportSpecifierAlias(referenceLocation, exportSpecifier) && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier) || referenceSymbol;
138277 }
138278 function isExportSpecifierAlias(referenceLocation, exportSpecifier) {
138279 var parent = exportSpecifier.parent, propertyName = exportSpecifier.propertyName, name = exportSpecifier.name;
138280 ts.Debug.assert(propertyName === referenceLocation || name === referenceLocation);
138281 if (propertyName) {
138282 // Given `export { foo as bar } [from "someModule"]`: It's an alias at `foo`, but at `bar` it's a new symbol.
138283 return propertyName === referenceLocation;
138284 }
138285 else {
138286 // `export { foo } from "foo"` is a re-export.
138287 // `export { foo };` is not a re-export, it creates an alias for the local variable `foo`.
138288 return !parent.parent.moduleSpecifier;
138289 }
138290 }
138291 function getImportOrExportReferences(referenceLocation, referenceSymbol, search, state) {
138292 var importOrExport = FindAllReferences.getImportOrExportSymbol(referenceLocation, referenceSymbol, state.checker, search.comingFrom === 1 /* ImportExport.Export */);
138293 if (!importOrExport)

Callers 1

Calls 1

assertMethod · 0.80

Tested by

no test coverage detected