Skip to content

Commit

Permalink
Merge pull request #286 from jakubhruby/master
Browse files Browse the repository at this point in the history
Fix _extend fn - alter provided object
  • Loading branch information
terehov authored Jun 8, 2024
2 parents 8190017 + 135ee61 commit 7e47b61
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/runtime/browser/util.inspect.polyfil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,13 +381,12 @@ function _extend(origin: object, add: object) {
// Don't do anything if add isn't an object
if (!add || !isObject(add)) return origin;

const clonedOrigin = { ...origin } as { [key: string]: unknown };
const clonedAdd = { ...add } as { [key: string]: unknown };

const keys = Object.keys(add);
let i = keys.length;
while (i--) {
clonedOrigin[keys[i]] = clonedAdd[keys[i]];
origin[keys[i]] = clonedAdd[keys[i]];
}
return origin;
}
Expand Down

0 comments on commit 7e47b61

Please sign in to comment.