From 62030cad96e7b3b2992694d83d895d7cd3860c58 Mon Sep 17 00:00:00 2001 From: Alexandr <55993184+BubbleSortt@users.noreply.github.com> Date: Fri, 26 Apr 2024 17:44:51 +0300 Subject: [PATCH] fix(nuxt): handle arrays correctly in `updateAppConfig` (#26949) --- packages/nuxt/src/app/config.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/nuxt/src/app/config.ts b/packages/nuxt/src/app/config.ts index 922ad0c3cd..6b6370e542 100644 --- a/packages/nuxt/src/app/config.ts +++ b/packages/nuxt/src/app/config.ts @@ -27,7 +27,8 @@ function deepAssign (obj: any, newObj: any) { for (const key in newObj) { const val = newObj[key] if (val !== null && typeof val === 'object') { - obj[key] = obj[key] || {} + const defaultVal = Array.isArray(val) ? [] : {} + obj[key] = obj[key] || defaultVal deepAssign(obj[key], val) } else { obj[key] = val