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

Function getClass

packages/compiler-cli/src/ngtsc/core/test/compiler_spec.ts:447–454  ·  view source on GitHub ↗
(sf: ts.SourceFile, name: string)

Source from the content-addressed store, hash-verified

445});
446
447function getClass(sf: ts.SourceFile, name: string): ClassDeclaration<ts.ClassDeclaration> {
448 for (const stmt of sf.statements) {
449 if (isNamedClassDeclaration(stmt) && stmt.name.text === name) {
450 return stmt;
451 }
452 }
453 throw new Error(`Class ${name} not found in file: ${sf.fileName}: ${sf.text}`);
454}

Callers 1

compiler_spec.tsFile · 0.70

Calls 1

isNamedClassDeclarationFunction · 0.90

Tested by

no test coverage detected