We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1c65b6d commit 4e609e5Copy full SHA for 4e609e5
src/utils/helper.js
@@ -11,8 +11,15 @@ helper.getCopyState = function (state) {
11
helper.assingAll = function (targetObj, ...sourcObjs) {
12
// copy all enumerable and not enumerable properties into the target
13
sourcObjs.map(sourcObj => {
14
+ const enum_only = Object.keys(sourcObj);
15
Object.getOwnPropertyNames(sourcObj).map(prop => {
- targetObj[prop] = sourcObj[prop];
16
+ if (enum_only.indexOf(prop) >= 0)
17
+ targetObj[prop] = sourcObj[prop];
18
+ else
19
+ Object.defineProperty(targetObj, prop, {
20
+ value: sourcObj[prop],
21
+ writable: true
22
+ });
23
});
24
25
return targetObj;
0 commit comments