From e77eaf87f77397adee074cb5155beb3a0538cdd1 Mon Sep 17 00:00:00 2001 From: Jonas Lagoni Date: Mon, 12 Feb 2024 13:44:16 +0100 Subject: [PATCH] fix: partial and playground (#1788) --- src/utils/Partials.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/utils/Partials.ts b/src/utils/Partials.ts index d37fc250d2..3e69203a5f 100644 --- a/src/utils/Partials.ts +++ b/src/utils/Partials.ts @@ -49,10 +49,7 @@ export function mergePartialAndDefault>( const isArray = Array.isArray(prop); if (isArray) { // merge array into target with a new array instance so we dont touch the default value - target[propName] = Array(target[propName]); - for (const [index, value] of prop.entries()) { - target[propName][index] = value; - } + target[propName] = [...(target[propName] ?? []), ...(prop ?? [])]; } else if (isObjectOrClass && isRegularObject) { target[propName] = mergePartialAndDefault(target[propName], prop); } else if (prop) {