MCPcopy Index your code
hub / github.com/angular/angular-cli / readFile

Function readFile

packages/ngtools/webpack/src/ivy/system.ts:35–50  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

33 const system: ts.System = {
34 ...ts.sys,
35 readFile(path: string) {
36 let data;
37 try {
38 data = input.readFileSync(externalizePath(path));
39 } catch {
40 return undefined;
41 }
42
43 // Strip BOM if present
44 let start = 0;
45 if (data.length > 3 && data[0] === 0xef && data[1] === 0xbb && data[2] === 0xbf) {
46 start = 3;
47 }
48
49 return data.toString('utf8', start);
50 },
51 getFileSize(path: string) {
52 try {
53 return input.statSync(externalizePath(path)).size;

Callers

nothing calls this directly

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected