@azrico/webobject 1.2.12 → 1.2.15
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.
|
@@ -354,7 +354,7 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
354
354
|
|
|
355
355
|
isChild = Boolean(p.isChild || p.ischild); //@ts-ignore
|
|
356
356
|
|
|
357
|
-
useDelta = Boolean(p.useDelta || p.usedelta); //@ts-ignore
|
|
357
|
+
useDelta = this.__use_delta || Boolean(p.useDelta || p.usedelta); //@ts-ignore
|
|
358
358
|
|
|
359
359
|
allProperties = Boolean(p.allProperties || p.allproperties);
|
|
360
360
|
chkChangables = this.__changeables != null || this.__unchangeables != null;
|
|
@@ -71,8 +71,8 @@ export declare class SimpleObject extends MapableObject {
|
|
|
71
71
|
get allproperties(): this & Partial<this>;
|
|
72
72
|
get canModify(): boolean;
|
|
73
73
|
get __cache_name(): string;
|
|
74
|
-
get __changeables(): string;
|
|
75
|
-
get __unchangeables(): string;
|
|
74
|
+
get __changeables(): string[];
|
|
75
|
+
get __unchangeables(): string[];
|
|
76
76
|
get __use_delta(): boolean;
|
|
77
77
|
get isSaved(): boolean;
|
|
78
78
|
get isNew(): boolean;
|
|
@@ -503,7 +503,30 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject) {
|
|
|
503
503
|
|
|
504
504
|
/* -------------------------------------------------------------------------- */
|
|
505
505
|
function get() {
|
|
506
|
-
|
|
506
|
+
var _this2 = this;
|
|
507
|
+
|
|
508
|
+
if (this.__use_delta) return !(0, _object.object_isEmpty)(this.__delta);else {
|
|
509
|
+
var orig = this.getOriginal();
|
|
510
|
+
if (!orig) return false; //we dont know if anything has changed
|
|
511
|
+
|
|
512
|
+
/* if object is not using delta mode, check changes by comparing changable fields with original object */
|
|
513
|
+
|
|
514
|
+
if (Array.isArray(this.__changeables)) {
|
|
515
|
+
//console.log("chk", this.__changeables, "for changes");
|
|
516
|
+
return this.__changeables.find(function (c) {
|
|
517
|
+
return _this2[c] !== orig[c];
|
|
518
|
+
}) != undefined;
|
|
519
|
+
} else {
|
|
520
|
+
/* check all fields */
|
|
521
|
+
for (var key in this) {
|
|
522
|
+
if (key.startsWith("__")) continue;
|
|
523
|
+
if (this[key] !== orig[key]) return true;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
return false;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
return false;
|
|
507
530
|
}
|
|
508
531
|
}, {
|
|
509
532
|
key: "isDeleted",
|