(ref: nga.ReferenceMetadata)
| 549 | |
| 550 | /** Identifier a reference resolves to in the emitting file (local binding or exported symbol). */ |
| 551 | export function refName(ref: nga.ReferenceMetadata): string { |
| 552 | const name = ref.localAlias ?? ref.consumerImport?.symbol ?? ref.typecheckImport?.symbol; |
| 553 | if (name === undefined) { |
| 554 | throw new Error('ReferenceMetadata has neither a local binding nor an import path'); |
| 555 | } |
| 556 | return name; |
| 557 | } |
| 558 | |
| 559 | export function refToExpression(ref: nga.ReferenceMetadata): o.Expression { |
| 560 | if (ref.localAlias) { |
no outgoing calls
no test coverage detected