Skip to content

Commit d9208cc

Browse files
committed
Update getDeepCopyTarget function to ensure types are not lost
1 parent 16b0f84 commit d9208cc

File tree

1 file changed

+7
-1
lines changed
  • packages/devextreme/js/__internal/core/utils

1 file changed

+7
-1
lines changed

packages/devextreme/js/__internal/core/utils/m_object.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,13 @@ const orderEach = function (map, func) {
4141

4242
const getDeepCopyTarget = (item) => {
4343
if (isObject(item)) {
44-
return Array.isArray(item) ? [] : {};
44+
if (Array.isArray(item)) {
45+
return [];
46+
}
47+
if (!isPlainObject(item)) {
48+
return Object.create(Object.getPrototypeOf(item));
49+
}
50+
return {};
4551
}
4652
return item;
4753
};

0 commit comments

Comments
 (0)