MCPcopy Create free account
hub / github.com/angular/angular / refToExpression

Function refToExpression

packages/compiler-cli/preprocessor/src/compiler-utils.ts:559–570  ·  view source on GitHub ↗
(ref: nga.ReferenceMetadata)

Source from the content-addressed store, hash-verified

557}
558
559export function refToExpression(ref: nga.ReferenceMetadata): o.Expression {
560 if (ref.localAlias) {
561 return o.variable(ref.localAlias);
562 }
563 if (ref.consumerImport) {
564 return new o.ExternalExpr({
565 moduleName: ref.consumerImport.specifier,
566 name: ref.consumerImport.symbol,
567 } as any);
568 }
569 return o.variable(refName(ref));
570}
571
572/**
573 * Converts a `ReferenceMetadata` to an expression suitable for `.d.ts` type parameter emission

Callers 8

refToTypeExpressionFunction · 0.85
buildHostDirectivesFunction · 0.85
compileClassesFunction · 0.85
mapToVarArrFunction · 0.85
mapToRefsFunction · 0.85
scopeArrayFunction · 0.85
compileNgModuleDefFunction · 0.85
buildInjectorImportsFunction · 0.85

Calls 1

refNameFunction · 0.85

Tested by

no test coverage detected