Skip to content

Commit

Permalink
fix(lib): correct the concat method in TokenizedStringFragments
Browse files Browse the repository at this point in the history
The concat method was not properly updating `this.fragments` because `Array.prototype.concat` does not modify the original array in place. Changed the implementation to use `push` with the spread operator to correctly merge fragments.
  • Loading branch information
suojae authored Nov 17, 2024
1 parent a524ac7 commit 4e09ea2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/cdktf/lib/tokens/string-fragments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class TokenizedStringFragments {
}

public concat(other: TokenizedStringFragments): void {
this.fragments.concat(other.fragments);
this.fragments.push(...other.fragments);
}

/**
Expand Down

0 comments on commit 4e09ea2

Please sign in to comment.