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

Function getFileContent

src/cdk/schematics/testing/file-content.ts:12–20  ·  view source on GitHub ↗
(tree: Tree, filePath: string)

Source from the content-addressed store, hash-verified

10
11/** Gets the content of a specified file from a schematic tree. */
12export function getFileContent(tree: Tree, filePath: string): string {
13 const contentBuffer = tree.read(filePath);
14
15 if (!contentBuffer) {
16 throw new Error(`Cannot read "${filePath}" because it does not exist.`);
17 }
18
19 return contentBuffer.toString();
20}

Callers 9

index.spec.tsFile · 0.90
index.spec.tsFile · 0.90
index.spec.tsFile · 0.90
index.spec.tsFile · 0.90
index.spec.tsFile · 0.90
index.spec.tsFile · 0.90
index.spec.tsFile · 0.90
index.spec.tsFile · 0.90

Calls 2

readMethod · 0.80
toStringMethod · 0.80

Tested by 1