@azrico/webobject 1.4.189 → 1.4.190
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.
|
@@ -470,6 +470,8 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
470
470
|
/**
|
|
471
471
|
* converts this object to an basic object
|
|
472
472
|
* that can be passed into client components from server components
|
|
473
|
+
*
|
|
474
|
+
* uses `get_fullDeltaObject`
|
|
473
475
|
* @param p
|
|
474
476
|
* @returns
|
|
475
477
|
*/
|
|
@@ -477,7 +479,7 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
477
479
|
key: "get_basicObject",
|
|
478
480
|
value: (function () {
|
|
479
481
|
var _get_basicObject = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
480
|
-
var fulldelta,
|
|
482
|
+
var fulldelta, key, element;
|
|
481
483
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
482
484
|
while (1) switch (_context8.prev = _context8.next) {
|
|
483
485
|
case 0:
|
|
@@ -485,20 +487,19 @@ var WebObject = exports.WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
485
487
|
return this.get_fullDeltaObject();
|
|
486
488
|
case 2:
|
|
487
489
|
fulldelta = _context8.sent;
|
|
488
|
-
idFields = ["id", "parentid"];
|
|
489
|
-
idFields.forEach(function (r) {
|
|
490
|
-
if (r in fulldelta) {
|
|
491
|
-
fulldelta[r] = String(fulldelta[r]);
|
|
492
|
-
}
|
|
493
|
-
});
|
|
494
490
|
for (key in fulldelta) {
|
|
495
491
|
element = fulldelta[key];
|
|
496
|
-
|
|
497
|
-
|
|
492
|
+
/* --------------------------- check for id fields -------------------------- */
|
|
493
|
+
if (element != null && _typeof(element) === "object") {
|
|
494
|
+
if ((key === "id" || key.endsWith("_id")) && typeof element.toString === "function") {
|
|
495
|
+
fulldelta[key] = String(element);
|
|
496
|
+
} else {
|
|
497
|
+
fulldelta[key] = JSON.parse(JSON.stringify(element));
|
|
498
|
+
}
|
|
498
499
|
}
|
|
499
500
|
}
|
|
500
501
|
return _context8.abrupt("return", fulldelta);
|
|
501
|
-
case
|
|
502
|
+
case 5:
|
|
502
503
|
case "end":
|
|
503
504
|
return _context8.stop();
|
|
504
505
|
}
|
|
@@ -69,6 +69,7 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
|
|
|
69
69
|
_defineProperty(_this, "__saveResultObject", void 0);
|
|
70
70
|
_defineProperty(_this, "__saveResultIsSuccess", true);
|
|
71
71
|
_defineProperty(_this, "__saveResultType", void 0);
|
|
72
|
+
//id in the database
|
|
72
73
|
_defineProperty(_this, "_id", "");
|
|
73
74
|
//sequence key (usually managed by the database)
|
|
74
75
|
_defineProperty(_this, "_index_key", "");
|
|
@@ -827,7 +828,7 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
|
|
|
827
828
|
////for (const key in this.__delta) {
|
|
828
829
|
//// return true;
|
|
829
830
|
////}
|
|
830
|
-
////return false;
|
|
831
|
+
////return false;
|
|
831
832
|
}
|
|
832
833
|
/* --------------------- check the properties one by one -------------------- */
|
|
833
834
|
var orig = this.getOriginal();
|