(namedBindings)
| 136458 | } |
| 136459 | } |
| 136460 | function searchForNamedImport(namedBindings) { |
| 136461 | if (!namedBindings) { |
| 136462 | return; |
| 136463 | } |
| 136464 | for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { |
| 136465 | var element = _a[_i]; |
| 136466 | var name = element.name, propertyName = element.propertyName; |
| 136467 | if (!isNameMatch((propertyName || name).escapedText)) { |
| 136468 | continue; |
| 136469 | } |
| 136470 | if (propertyName) { |
| 136471 | // This is `import { foo as bar } from "./a"` or `export { foo as bar } from "./a"`. `foo` isn't a local in the file, so just add it as a single reference. |
| 136472 | singleReferences.push(propertyName); |
| 136473 | // If renaming `{ foo as bar }`, don't touch `bar`, just `foo`. |
| 136474 | // But do rename `foo` in ` { default as foo }` if that's the original export name. |
| 136475 | if (!isForRename || name.escapedText === exportSymbol.escapedName) { |
| 136476 | // Search locally for `bar`. |
| 136477 | addSearch(name, checker.getSymbolAtLocation(name)); |
| 136478 | } |
| 136479 | } |
| 136480 | else { |
| 136481 | var localSymbol = element.kind === 275 /* SyntaxKind.ExportSpecifier */ && element.propertyName |
| 136482 | ? checker.getExportSpecifierLocalTargetSymbol(element) // For re-exporting under a different name, we want to get the re-exported symbol. |
| 136483 | : checker.getSymbolAtLocation(name); |
| 136484 | addSearch(name, localSymbol); |
| 136485 | } |
| 136486 | } |
| 136487 | } |
| 136488 | function isNameMatch(name) { |
| 136489 | // Use name of "default" even in `export =` case because we may have allowSyntheticDefaultImports |
| 136490 | return name === exportSymbol.escapedName || exportKind !== 0 /* ExportKind.Named */ && name === "default" /* InternalSymbolName.Default */; |
no test coverage detected