Skip to content

Commit

Permalink
fix: Duplicate values during deep assign of extra files (#7019)
Browse files Browse the repository at this point in the history
Filters out duplicate assign's when cascading configs (files, extraFiles, etc.) by converting to Set first
  • Loading branch information
mmaietta authored Jul 21, 2022
1 parent 62cf003 commit 98d3a63
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/mean-cheetahs-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"builder-util": patch
---

fix: Filter out duplicate values during deep assign of extra files by converting to Set first
2 changes: 1 addition & 1 deletion packages/builder-util/src/deepAssign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function assignKey(target: any, from: any, key: string) {
if (prevValue == null || value == null || !isObject(prevValue) || !isObject(value)) {
// Merge arrays.
if (Array.isArray(prevValue) && Array.isArray(value)) {
target[key] = prevValue.concat(value)
target[key] = Array.from(new Set(prevValue.concat(value)))
} else {
target[key] = value
}
Expand Down

0 comments on commit 98d3a63

Please sign in to comment.