( tree: Tree, path: string, content: string )
| 7 | export const stringifyFormatted = (obj: any) => JSON.stringify(obj, null, 2); |
| 8 | |
| 9 | export 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 | |
| 21 | export function safeReadJSON(path: string, tree: Tree) { |
| 22 | try { |
no test coverage detected