@azrico/webobject 1.4.40 → 1.4.42
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.
|
@@ -83,6 +83,7 @@ export declare class SimpleObject extends MapableObject {
|
|
|
83
83
|
* @return true if changed , false otherwise
|
|
84
84
|
*/
|
|
85
85
|
setSubValue<MKey extends PropOf<this>>(key: MKey, objKey: string, subvalue: any, sendChanges?: sendChangesType): Promise<boolean>;
|
|
86
|
+
getSubValue: (key: PropOf<this>, subkey: string, original?: boolean) => any;
|
|
86
87
|
/**
|
|
87
88
|
* Push value on array
|
|
88
89
|
* @param key
|
|
@@ -105,6 +105,7 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject) {
|
|
|
105
105
|
* @returns
|
|
106
106
|
*/
|
|
107
107
|
_defineProperty(_assertThisInitialized(_this), "setDefault", _this.setDefaultValue);
|
|
108
|
+
_defineProperty(_assertThisInitialized(_this), "getSubValue", _classPrivateMethodGet(_assertThisInitialized(_this), _getSubProperty, _getSubProperty2));
|
|
108
109
|
_defineProperty(_assertThisInitialized(_this), "get_managerClass", function () {
|
|
109
110
|
return undefined;
|
|
110
111
|
});
|
|
@@ -319,7 +320,8 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject) {
|
|
|
319
320
|
//if accessing subval of an object, make sure the object is not null
|
|
320
321
|
subval = _classPrivateMethodGet(this, _getSubProperty, _getSubProperty2).call(this, key, objKey);
|
|
321
322
|
if (!(0, _object.object_equals)(subval, subvalue, {
|
|
322
|
-
ignoredStartingWords: "_"
|
|
323
|
+
ignoredStartingWords: "_",
|
|
324
|
+
strictArrayCheck: true
|
|
323
325
|
})) {
|
|
324
326
|
_classPrivateMethodGet(this, _setSubProperty, _setSubProperty2).call(this, key, objKey, subvalue);
|
|
325
327
|
isValueChanged = true;
|
|
@@ -347,6 +349,9 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject) {
|
|
|
347
349
|
}
|
|
348
350
|
return setSubValue;
|
|
349
351
|
}()
|
|
352
|
+
}, {
|
|
353
|
+
key: "pushValue",
|
|
354
|
+
value:
|
|
350
355
|
/**
|
|
351
356
|
* Push value on array
|
|
352
357
|
* @param key
|
|
@@ -354,9 +359,7 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject) {
|
|
|
354
359
|
* @param sendChanges
|
|
355
360
|
* @returns
|
|
356
361
|
*/
|
|
357
|
-
|
|
358
|
-
key: "pushValue",
|
|
359
|
-
value: function () {
|
|
362
|
+
function () {
|
|
360
363
|
var _pushValue = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(key, value) {
|
|
361
364
|
var sendChanges,
|
|
362
365
|
tempArray,
|
|
@@ -1094,7 +1097,7 @@ exports.SimpleObject = SimpleObject;
|
|
|
1094
1097
|
function _setSubProperty2(key, subkey, value) {
|
|
1095
1098
|
var subobj = _classPrivateMethodGet(this, _getProperty, _getProperty2).call(this, key);
|
|
1096
1099
|
//@ts-ignore
|
|
1097
|
-
if (subobj == null || _typeof(subobj) !== "object") subobj = {};
|
|
1100
|
+
if (subobj == null || _typeof(subobj) !== "object") subobj = {};else subobj = _objectSpread({}, subobj); //make a clone so we dont update the original
|
|
1098
1101
|
subobj[subkey] = value;
|
|
1099
1102
|
_classPrivateMethodGet(this, _setProperty, _setProperty2).call(this, key, subobj);
|
|
1100
1103
|
}
|
|
@@ -1114,7 +1117,6 @@ function _setProperty2(key, value) {
|
|
|
1114
1117
|
} else {
|
|
1115
1118
|
this.__delta[key] = value; //always update delta to keep track of changes
|
|
1116
1119
|
if (!this.__use_delta) {
|
|
1117
|
-
console.log("noDelta also update obj", key, value);
|
|
1118
1120
|
this[key] = value; //on noDelta mode, also update the obj
|
|
1119
1121
|
}
|
|
1120
1122
|
|