File tree
Expand file treeCollapse file tree1 file changed
+10
-3
lines changed packages/schematics/angular/utility
Expand file treeCollapse file tree1 file changed
+10
-3
lines changed Original file line number | Diff line number | Diff line change |
---|
@@ -95,9 +95,16 @@ export class JSONFile {
|
95 | 95 | },
|
96 | 96 | });
|
97 | 97 |
|
98 |
| -this.content = applyEdits(this.content, edits); |
99 |
| -this.host.overwrite(this.path, this.content); |
100 |
| -this._jsonAst = undefined; |
| 98 | +if (edits.length > 0) { |
| 99 | +const editedContent = applyEdits(this.content, edits); |
| 100 | + |
| 101 | +// Update the file content if it changed |
| 102 | +if (editedContent !== this.content) { |
| 103 | +this.content = editedContent; |
| 104 | +this.host.overwrite(this.path, editedContent); |
| 105 | +this._jsonAst = undefined; |
| 106 | +} |
| 107 | +} |
101 | 108 | }
|
102 | 109 |
|
103 | 110 | remove(jsonPath: JSONPath): void {
|
|
You can’t perform that action at this time.
0 commit comments