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

Function getClass

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

Source from the content-addressed store, hash-verified

890}
891
892export function getClass(sf: ts.SourceFile, name: string): ClassDeclaration<ts.ClassDeclaration> {
893 for (const stmt of sf.statements) {
894 if (isNamedClassDeclaration(stmt) && stmt.name.text === name) {
895 return stmt;
896 }
897 }
898 throw new Error(`Class ${name} not found in file: ${sf.fileName}: ${sf.text}`);
899}
900
901export function getFunction(
902 sf: ts.SourceFile,

Calls 1

isNamedClassDeclarationFunction · 0.90

Tested by 1

diagnoseTestComponentFunction · 0.72