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

Function getClass

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

Source from the content-addressed store, hash-verified

619}
620
621export function getClass(sf: ts.SourceFile, name: string): ClassDeclaration<ts.ClassDeclaration> {
622 for (const stmt of sf.statements) {
623 if (isNamedClassDeclaration(stmt) && stmt.name.text === name) {
624 return stmt;
625 }
626 }
627 throw new Error(`Class ${name} not found in file: ${sf.fileName}: ${sf.text}`);
628}
629
630export function getFunction(
631 sf: ts.SourceFile,

Calls 1

isNamedClassDeclarationFunction · 0.90

Tested by

no test coverage detected