@azrico/webobject 1.5.26 → 1.5.28
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/src/WebObjects/WebObject.js +38 -36
- package/package.json +1 -1
|
@@ -588,7 +588,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
588
588
|
key: "get_deltaObject",
|
|
589
589
|
value: (function () {
|
|
590
590
|
var _get_deltaObject = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(p) {
|
|
591
|
-
var final_object, useDelta,
|
|
591
|
+
var final_object, useDelta, changedFields, key, changableKeys, functionProps, index, fp, parseObj, _parseObj, _iterator, _step, _key, gotIndex, gotId, tempusers;
|
|
592
592
|
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
593
593
|
while (1) switch (_context13.prev = _context13.next) {
|
|
594
594
|
case 0:
|
|
@@ -662,28 +662,27 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
662
662
|
return _parseObj.apply(this, arguments);
|
|
663
663
|
};
|
|
664
664
|
if (!p) p = {};
|
|
665
|
-
final_object = {};
|
|
666
|
-
useDelta = this.__use_delta || p.useDelta;
|
|
667
|
-
chkChangables = this.__changeables != null || this.__unchangeables != null;
|
|
665
|
+
final_object = {};
|
|
666
|
+
useDelta = Boolean(this.__use_delta || p.useDelta);
|
|
668
667
|
/**
|
|
669
668
|
* child objects usually dont update their __delta
|
|
670
669
|
* so we read info from all of its properties
|
|
671
670
|
*/
|
|
672
|
-
changedFields = Boolean(p.allProperties || !useDelta) ? _objectSpread({}, this.allproperties) : _objectSpread({}, this.__delta);
|
|
671
|
+
changedFields = Boolean(p.allProperties || p.isChild || !useDelta) ? _objectSpread({}, this.allproperties) : _objectSpread({}, this.__delta);
|
|
673
672
|
/* ------------- parse children that have WebObject as delta ------------- */
|
|
674
673
|
_context13.t0 = _regeneratorRuntime().keys(this);
|
|
675
|
-
case
|
|
674
|
+
case 7:
|
|
676
675
|
if ((_context13.t1 = _context13.t0()).done) {
|
|
677
|
-
_context13.next =
|
|
676
|
+
_context13.next = 14;
|
|
678
677
|
break;
|
|
679
678
|
}
|
|
680
679
|
key = _context13.t1.value;
|
|
681
680
|
if (!(key.startsWith("__") || key in changedFields)) {
|
|
682
|
-
_context13.next =
|
|
681
|
+
_context13.next = 11;
|
|
683
682
|
break;
|
|
684
683
|
}
|
|
685
|
-
return _context13.abrupt("continue",
|
|
686
|
-
case
|
|
684
|
+
return _context13.abrupt("continue", 7);
|
|
685
|
+
case 11:
|
|
687
686
|
if (_WebObjectHelper["default"].isChangedWebObjectField(this[key])) {
|
|
688
687
|
/**
|
|
689
688
|
* if a child has any change we must add it into our delta
|
|
@@ -692,12 +691,15 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
692
691
|
*/
|
|
693
692
|
changedFields[key] = this[key];
|
|
694
693
|
}
|
|
695
|
-
_context13.next =
|
|
694
|
+
_context13.next = 7;
|
|
696
695
|
break;
|
|
697
|
-
case
|
|
698
|
-
|
|
696
|
+
case 14:
|
|
697
|
+
/**
|
|
698
|
+
* get keys that can be changed.
|
|
699
|
+
* intersection of keys in delta and keys that are defined as changeable
|
|
700
|
+
*/
|
|
699
701
|
changableKeys = (0, _object.array_intersection)(Object.keys(changedFields), WebObject.getChangeableKeys(this, p));
|
|
700
|
-
_context13.next =
|
|
702
|
+
_context13.next = 17;
|
|
701
703
|
return _convert["default"].applyFormats({
|
|
702
704
|
inputobject: changedFields,
|
|
703
705
|
formats: (0, _object.object_getStatic)(this, "__formatList"),
|
|
@@ -705,7 +707,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
705
707
|
changableKeys: changableKeys,
|
|
706
708
|
applyDefaults: true
|
|
707
709
|
});
|
|
708
|
-
case
|
|
710
|
+
case 17:
|
|
709
711
|
/* -------------------------------------------------------------------------- */
|
|
710
712
|
/* __functionProperties */
|
|
711
713
|
/* -------------------------------------------------------------------------- */
|
|
@@ -718,33 +720,33 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
718
720
|
/* parse all changableKeys */
|
|
719
721
|
/* -------------------------------------------------------------------------- */
|
|
720
722
|
_iterator = _createForOfIteratorHelper(changableKeys);
|
|
721
|
-
_context13.prev =
|
|
723
|
+
_context13.prev = 20;
|
|
722
724
|
_iterator.s();
|
|
723
|
-
case
|
|
725
|
+
case 22:
|
|
724
726
|
if ((_step = _iterator.n()).done) {
|
|
725
|
-
_context13.next =
|
|
727
|
+
_context13.next = 29;
|
|
726
728
|
break;
|
|
727
729
|
}
|
|
728
730
|
_key = _step.value;
|
|
729
|
-
_context13.next =
|
|
731
|
+
_context13.next = 26;
|
|
730
732
|
return parseObj(changedFields[_key]);
|
|
731
|
-
case
|
|
733
|
+
case 26:
|
|
732
734
|
final_object[_key] = _context13.sent;
|
|
733
|
-
case
|
|
734
|
-
_context13.next =
|
|
735
|
+
case 27:
|
|
736
|
+
_context13.next = 22;
|
|
735
737
|
break;
|
|
736
|
-
case
|
|
737
|
-
_context13.next =
|
|
738
|
+
case 29:
|
|
739
|
+
_context13.next = 34;
|
|
738
740
|
break;
|
|
739
|
-
case
|
|
740
|
-
_context13.prev =
|
|
741
|
-
_context13.t2 = _context13["catch"](
|
|
741
|
+
case 31:
|
|
742
|
+
_context13.prev = 31;
|
|
743
|
+
_context13.t2 = _context13["catch"](20);
|
|
742
744
|
_iterator.e(_context13.t2);
|
|
743
|
-
case
|
|
744
|
-
_context13.prev =
|
|
745
|
+
case 34:
|
|
746
|
+
_context13.prev = 34;
|
|
745
747
|
_iterator.f();
|
|
746
|
-
return _context13.finish(
|
|
747
|
-
case
|
|
748
|
+
return _context13.finish(34);
|
|
749
|
+
case 37:
|
|
748
750
|
/* -------------------- add acrhived and date properties -------------------- */
|
|
749
751
|
if (p.allProperties) {
|
|
750
752
|
final_object["_created_date"] = this["_created_date"];
|
|
@@ -752,7 +754,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
752
754
|
final_object["_deleted"] = this.isDeleted;
|
|
753
755
|
}
|
|
754
756
|
/* ---------------------------- add id properties --------------------------- */
|
|
755
|
-
if (p.allProperties || p.needId) {
|
|
757
|
+
if (p.allProperties || p.needId || p.isChild) {
|
|
756
758
|
if (this["_index_key"]) final_object["_index_key"] = this["_index_key"];
|
|
757
759
|
gotIndex = this.getIndex();
|
|
758
760
|
gotId = this.getID();
|
|
@@ -770,17 +772,17 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
770
772
|
final_object["_users"] = (0, _object.wrap_array)(tempusers);
|
|
771
773
|
}
|
|
772
774
|
if (!p.clean) {
|
|
773
|
-
_context13.next =
|
|
775
|
+
_context13.next = 42;
|
|
774
776
|
break;
|
|
775
777
|
}
|
|
776
778
|
return _context13.abrupt("return", (0, _object.object_clean)(final_object, false, true));
|
|
777
|
-
case
|
|
779
|
+
case 42:
|
|
778
780
|
return _context13.abrupt("return", final_object);
|
|
779
|
-
case
|
|
781
|
+
case 43:
|
|
780
782
|
case "end":
|
|
781
783
|
return _context13.stop();
|
|
782
784
|
}
|
|
783
|
-
}, _callee13, this, [[
|
|
785
|
+
}, _callee13, this, [[20, 31, 34, 37]]);
|
|
784
786
|
}));
|
|
785
787
|
function get_deltaObject(_x5) {
|
|
786
788
|
return _get_deltaObject.apply(this, arguments);
|