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

Function getClass

packages/compiler-cli/src/ngtsc/typecheck/testing/index.ts:915–922  ·  view source on GitHub ↗
(sf: ts.SourceFile, name: string)

Source from the content-addressed store, hash-verified

913}
914
915export function getClass(sf: ts.SourceFile, name: string): ClassDeclaration<ts.ClassDeclaration> {
916 for (const stmt of sf.statements) {
917 if (isNamedClassDeclaration(stmt) && stmt.name.text === name) {
918 return stmt;
919 }
920 }
921 throw new Error(`Class ${name} not found in file: ${sf.fileName}: ${sf.text}`);
922}
923
924export function getFunction(
925 sf: ts.SourceFile,

Calls 1

isNamedClassDeclarationFunction · 0.90

Tested by 1

diagnoseTestComponentFunction · 0.72