(host: Tree, path: string)
| 18 | |
| 19 | /** Reads file given path and returns TypeScript source file. */ |
| 20 | export 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. */ |
| 29 | export function addModuleImportToRootModule( |
no test coverage detected