DEV: Use object spread instead of Object.assign (#30407)

This commit is contained in:
Jarek Radosz
2024-12-23 08:44:29 +01:00
committed by GitHub
parent 6f01584607
commit 0336235c74
9 changed files with 26 additions and 40 deletions

View File

@ -14,10 +14,7 @@ export function deepMerge(...objects) {
if (Array.isArray(targetValue) && Array.isArray(sourceValue)) {
target[key] = targetValue.concat(sourceValue);
} else if (isObject(targetValue) && isObject(sourceValue)) {
target[key] = deepMergeInner(
Object.assign({}, targetValue),
sourceValue
);
target[key] = deepMergeInner({ ...targetValue }, sourceValue);
} else {
target[key] = sourceValue;
}