fix(nuxt): handle arrays correctly in updateAppConfig (#26949)

This commit is contained in:
Alexandr 2024-04-26 17:44:51 +03:00 committed by GitHub
parent 72c3cbe12a
commit 62030cad96
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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