dataflux 1.22.0 → 1.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Obj.js CHANGED
@@ -63,14 +63,19 @@ var Obj = exports["default"] = /*#__PURE__*/function (_BasicObj) {
63
63
  return _superPropGet((_this, Obj), "delete", _this, 3)([attribute]);
64
64
  });
65
65
  _defineProperty(_this, "set", function (attribute, value, hidden) {
66
- if (Array.isArray(value) && _this.getModel().options.deep) {
67
- value = value.map(function (i) {
68
- if (["boolean", "string", "number"].includes(_typeof(i))) {
69
- return i;
70
- } else {
71
- return i !== null && i !== void 0 && i.getId ? i : new _SubObj["default"](_this, "property", i, _this.getModel());
72
- }
73
- });
66
+ if (_this.getModel().options.deep) {
67
+ if (Array.isArray(value)) {
68
+ value = value.map(function (i) {
69
+ if (["boolean", "string", "number"].includes(_typeof(i))) {
70
+ return i;
71
+ } else {
72
+ return i !== null && i !== void 0 && i.getId ? i : new _SubObj["default"](_this, "property", i, _this.getModel());
73
+ }
74
+ });
75
+ } else if (_typeof(value) === "object") {
76
+ var _value;
77
+ value = (_value = value) !== null && _value !== void 0 && _value.getId ? value : new _SubObj["default"](_this, "property", value, _this.getModel());
78
+ }
74
79
  }
75
80
  return _superPropGet((_this, Obj), "set", _this, 3)([attribute, value, hidden]);
76
81
  });