@azrico/webobject 1.4.126 → 1.4.128
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.
|
@@ -128,7 +128,7 @@ export declare class SimpleObject extends MapableObject {
|
|
|
128
128
|
}): boolean;
|
|
129
129
|
static hasIllegalChanges(referenceObject: any, changesObject: any, updaterUser: any): boolean;
|
|
130
130
|
/**
|
|
131
|
-
* Apply the changes and empty the delta object
|
|
131
|
+
* Apply all the changes and empty the delta object
|
|
132
132
|
*/
|
|
133
133
|
apply_changes(): boolean;
|
|
134
134
|
/**
|
|
@@ -136,7 +136,7 @@ export declare class SimpleObject extends MapableObject {
|
|
|
136
136
|
* @param key
|
|
137
137
|
* @returns
|
|
138
138
|
*/
|
|
139
|
-
apply(
|
|
139
|
+
apply(keylist: PropOf<this> | Array<PropOf<this>>): boolean;
|
|
140
140
|
/**
|
|
141
141
|
* set the value to its original
|
|
142
142
|
* @param key
|
|
@@ -587,7 +587,7 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
|
|
|
587
587
|
/* Changes */
|
|
588
588
|
/* -------------------------------------------------------------------------- */
|
|
589
589
|
/**
|
|
590
|
-
* Apply the changes and empty the delta object
|
|
590
|
+
* Apply all the changes and empty the delta object
|
|
591
591
|
*/
|
|
592
592
|
function apply_changes() {
|
|
593
593
|
try {
|
|
@@ -616,18 +616,22 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
|
|
|
616
616
|
*/
|
|
617
617
|
}, {
|
|
618
618
|
key: "apply",
|
|
619
|
-
value: function apply(
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
619
|
+
value: function apply(keylist) {
|
|
620
|
+
var _this2 = this;
|
|
621
|
+
(0, _object.wrap_array)(keylist).forEach(function (key) {
|
|
622
|
+
try {
|
|
623
|
+
if (!_this2.__use_delta) {
|
|
624
|
+
//in this mode , we track changes by updating the original
|
|
625
|
+
return true;
|
|
626
|
+
}
|
|
627
|
+
if (_this2.__delta != null && key in _this2.__delta) {
|
|
628
|
+
_this2[key] = _this2.__delta[key];
|
|
629
|
+
delete _this2.__delta[key];
|
|
630
|
+
}
|
|
623
631
|
return true;
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
delete this.__delta[key];
|
|
628
|
-
}
|
|
629
|
-
return true;
|
|
630
|
-
} finally {}
|
|
632
|
+
} finally {}
|
|
633
|
+
});
|
|
634
|
+
return true;
|
|
631
635
|
}
|
|
632
636
|
/**
|
|
633
637
|
* set the value to its original
|
|
@@ -735,7 +739,7 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
|
|
|
735
739
|
/* Get/Check */
|
|
736
740
|
/* -------------------------------------------------------------------------- */
|
|
737
741
|
function get() {
|
|
738
|
-
var
|
|
742
|
+
var _this3 = this;
|
|
739
743
|
////const deltaIsBlank = object_isEmpty(this.__delta);
|
|
740
744
|
////if (!deltaIsBlank) return true; //delta is not blank, definitely changed
|
|
741
745
|
////if (this.__use_delta) return !deltaIsBlank; //trust the delta.
|
|
@@ -749,7 +753,7 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
|
|
|
749
753
|
if (Array.isArray(this.__changeables)) {
|
|
750
754
|
//console.log("chk", this.__changeables, "for changes");
|
|
751
755
|
return this.__changeables.find(function (c) {
|
|
752
|
-
return !(0, _object.object_equals)(
|
|
756
|
+
return !(0, _object.object_equals)(_this3[c], orig[c]);
|
|
753
757
|
}) != undefined;
|
|
754
758
|
} else {
|
|
755
759
|
/* check all fields */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azrico/webobject",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.128",
|
|
4
4
|
"description": "Stateful object",
|
|
5
5
|
"author": "Azrideus",
|
|
6
6
|
"license": "MIT",
|
|
@@ -75,10 +75,10 @@
|
|
|
75
75
|
"@azrico/event": "^1.2.17",
|
|
76
76
|
"@azrico/global": "^1.3.69",
|
|
77
77
|
"@azrico/math": "^1.0.5",
|
|
78
|
-
"@azrico/object": "^1.4.
|
|
78
|
+
"@azrico/object": "^1.4.101",
|
|
79
79
|
"@azrico/string": "^1.2.91",
|
|
80
|
-
"@azrico/types": "^1.0.
|
|
81
|
-
"@azrico/uid": "^1.0.
|
|
80
|
+
"@azrico/types": "^1.0.5",
|
|
81
|
+
"@azrico/uid": "^1.0.7"
|
|
82
82
|
},
|
|
83
83
|
"packageManager": "yarn@3.5.0"
|
|
84
84
|
}
|