Skip to content

Commit

Permalink
chore(fix): use cloneObject to preserve prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Jun 24, 2024
1 parent 6d83c32 commit 7af13ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ export const assign = <X extends Record<string | symbol | number, any>>(
override: X
): X => {
if (!initial || !override) return initial ?? override ?? {}
const merged = { ...initial }
const merged = cloneObject(initial)
for (const key in override) {
if (hasOwnProperty(override, key)) {
merged[key] = isPlainObject(initial[key])
Expand Down

0 comments on commit 7af13ea

Please sign in to comment.