From 8dc2db5c53bbab5e16f627d424e37643f2b4fca8 Mon Sep 17 00:00:00 2001 From: Alec Larson <1925840+aleclarson@users.noreply.github.com> Date: Mon, 24 Jun 2024 03:10:38 -0400 Subject: [PATCH] chore(fix): use `cloneObject` to preserve prototype --- src/object.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/object.ts b/src/object.ts index e9277073..e14494e6 100644 --- a/src/object.ts +++ b/src/object.ts @@ -281,7 +281,7 @@ export const assign = >( 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])