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

Function sfExtensionData

packages/compiler-cli/src/ngtsc/shims/src/expando.ts:65–81  ·  view source on GitHub ↗
(sf: ts.SourceFile)

Source from the content-addressed store, hash-verified

63 * Returns the `NgExtensionData` for a given `ts.SourceFile`, adding it if none exists.
64 */
65export function sfExtensionData(sf: ts.SourceFile): NgExtensionData {
66 const extSf = sf as MaybeNgExtendedSourceFile;
67 if (extSf[NgExtension] !== undefined) {
68 // The file already has extension data, so return it directly.
69 return extSf[NgExtension]!;
70 }
71
72 // The file has no existing extension data, so add it and return it.
73 const extension: NgExtensionData = {
74 isTopLevelShim: false,
75 fileShim: null,
76 originalReferencedFiles: null,
77 taggedReferenceFiles: null,
78 };
79 extSf[NgExtension] = extension;
80 return extension;
81}
82
83/**
84 * Data associated with a per-shim instance `ts.SourceFile`.

Callers 8

constructorMethod · 0.90
generateSpecificMethod · 0.90
tagMethod · 0.90
setupFunction · 0.90
copyFileShimDataFunction · 0.85
untagTsFileFunction · 0.85
retagTsFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected