MCPcopy Create free account
hub / github.com/angular/components / parseSourceFile

Function parseSourceFile

src/cdk/schematics/utils/ast.ts:20–26  ·  view source on GitHub ↗
(host: Tree, path: string)

Source from the content-addressed store, hash-verified

18
19/** Reads file given path and returns TypeScript source file. */
20export function parseSourceFile(host: Tree, path: string): ts.SourceFile {
21 const buffer = host.read(path);
22 if (!buffer) {
23 throw new SchematicsException(`Could not find file for path: ${path}`);
24 }
25 return ts.createSourceFile(path, buffer.toString(), ts.ScriptTarget.Latest, true);
26}
27
28/** Import and add module to root app module. */
29export function addModuleImportToRootModule(

Callers 1

addModuleImportToModuleFunction · 0.85

Calls 2

readMethod · 0.80
toStringMethod · 0.80

Tested by

no test coverage detected