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 74613fe commit 8dc2db5
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 @@ -281,7 +281,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 8dc2db5

Please sign in to comment.