MCPcopy
hub / github.com/angular/angularfire / overwriteIfExists

Function overwriteIfExists

src/schematics/common.ts:9–19  ·  view source on GitHub ↗
(
  tree: Tree,
  path: string,
  content: string
)

Source from the content-addressed store, hash-verified

7export const stringifyFormatted = (obj: any) => JSON.stringify(obj, null, 2);
8
9export const overwriteIfExists = (
10 tree: Tree,
11 path: string,
12 content: string
13) => {
14 if (tree.exists(path)) {
15 tree.overwrite(path, content);
16 } else {
17 tree.create(path, content);
18 }
19};
20
21export function safeReadJSON(path: string, tree: Tree) {
22 try {

Callers 5

addFixesToServerFunction · 0.90
addIgnoreFilesFunction · 0.90
ngUpdateFunction · 0.90
addDependenciesFunction · 0.85

Calls 1

existsMethod · 0.65

Tested by

no test coverage detected