Skip to content

Commit

Permalink
Merge pull request #2161 from powerfulyang/master
Browse files Browse the repository at this point in the history
fix(swc): deepMerge didn't handle array type properly
  • Loading branch information
kamilmysliwiec committed Jul 11, 2023
2 parents be5d1d0 + bc18e83 commit c2e2d26
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/compiler/swc/swc-compiler.ts
Expand Up @@ -212,6 +212,13 @@ export class SwcCompiler extends BaseCompiler {
return source;
}

if (Array.isArray(target) && Array.isArray(source)) {
return source.reduce((acc, value, index) => {
acc[index] = this.deepMerge(target[index], value);
return acc;
}, target);
}

const merged = { ...target };
for (const key in source) {
if (source.hasOwnProperty(key)) {
Expand Down

0 comments on commit c2e2d26

Please sign in to comment.