Skip to content

Commit 07c73a1

Browse files
committed
fix(@angular-devkit/schematics): implement optimize() for HostTree
Its only used by old Schematics library, which can end up in there. Since optimization is only a thing for VirtualTree, HostTree returns itself.
1 parent 598c5da commit 07c73a1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/angular_devkit/schematics/src/tree/host-tree.ts

+6
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ export class HostTree implements Tree {
134134
return this._record.willRename(path);
135135
}
136136

137+
// This can be used by old Schematics library with new Trees in some corner cases.
138+
// TODO: remove this for 7.0
139+
optimize() {
140+
return this;
141+
}
142+
137143
branch(): Tree {
138144
const branchedTree = new HostTree(this._backend);
139145
branchedTree._record = this._record.clone();

0 commit comments

Comments
 (0)