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

Method write

packages/compiler-cli/test/ngtsc/env.ts:238–249  ·  view source on GitHub ↗
(fileName: string, content: string)

Source from the content-addressed store, hash-verified

236 }
237
238 write(fileName: string, content: string) {
239 const absFilePath = this.fs.resolve(this.basePath, fileName);
240 if (this.multiCompileHostExt !== null) {
241 this.multiCompileHostExt.invalidate(absFilePath);
242 this.ngpSession?.recordChangedFile(absFilePath, /* created */ !this.fs.exists(absFilePath));
243 if (!fileName.endsWith('.ts')) {
244 this.changedResources!.add(absFilePath);
245 }
246 }
247 this.fs.ensureDir(this.fs.dirname(absFilePath));
248 this.fs.writeFile(absFilePath, content);
249 }
250
251 invalidateCachedFile(fileName: string): void {
252 const absFilePath = this.fs.resolve(this.basePath, fileName);

Callers 2

setupMethod · 0.95
tsconfigMethod · 0.95

Calls 8

recordChangedFileMethod · 0.80
resolveMethod · 0.65
existsMethod · 0.65
addMethod · 0.65
ensureDirMethod · 0.65
dirnameMethod · 0.65
writeFileMethod · 0.65
invalidateMethod · 0.45

Tested by

no test coverage detected