Skip to content

Commit 35c13a6

Browse files
alan-agius4clydin
authored andcommitted
fix(@angular-devkit/schematics): set correct parent id in actions lists
Closes #18446
1 parent 0f0067f commit 35c13a6

File tree

1 file changed

+4
-3
lines changed
  • packages/angular_devkit/schematics/src/tree

1 file changed

+4
-3
lines changed

packages/angular_devkit/schematics/src/tree/action.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ export class ActionList implements Iterable<Action> {
3232
private _actions: Action[] = [];
3333

3434
protected _action(action: Partial<Action>) {
35-
this._actions.push(Object.assign({
35+
this._actions.push({
36+
...action as Action,
3637
id: _id++,
37-
parent: this._actions[this._actions.length - 1] || 0,
38-
}, action) as Action);
38+
parent: this._actions[this._actions.length - 1]?.id ?? 0,
39+
});
3940
}
4041

4142
create(path: Path, content: Buffer) {

0 commit comments

Comments
 (0)