@azrico/webobject 1.3.12 → 1.3.13

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.
@@ -48,6 +48,8 @@ export declare class SimpleObject extends MapableObject {
48
48
  setTemp: (key: string, value: any) => any;
49
49
  setDefaultValue(key: WriteablePropOf<this>, value: any): boolean;
50
50
  setDefault: (key: WriteablePropOf<this>, value: any) => boolean;
51
+ clearDeltaValue(key: WriteablePropOf<this>): boolean;
52
+ clear: (key: WriteablePropOf<this>) => boolean;
51
53
  /**
52
54
  * set key of subObject
53
55
  * @param key
@@ -41,6 +41,7 @@ function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(
41
41
  var _setSubProperty = /*#__PURE__*/new WeakSet();
42
42
  var _getSubProperty = /*#__PURE__*/new WeakSet();
43
43
  var _setProperty = /*#__PURE__*/new WeakSet();
44
+ var _clearDeltaProperty = /*#__PURE__*/new WeakSet();
44
45
  var _setDefaultProperty = /*#__PURE__*/new WeakSet();
45
46
  var _getProperty = /*#__PURE__*/new WeakSet();
46
47
  var _getTempProperty = /*#__PURE__*/new WeakSet();
@@ -63,6 +64,7 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject) {
63
64
  _classPrivateMethodInitSpec(_assertThisInitialized(_this), _getTempProperty);
64
65
  _classPrivateMethodInitSpec(_assertThisInitialized(_this), _getProperty);
65
66
  _classPrivateMethodInitSpec(_assertThisInitialized(_this), _setDefaultProperty);
67
+ _classPrivateMethodInitSpec(_assertThisInitialized(_this), _clearDeltaProperty);
66
68
  _classPrivateMethodInitSpec(_assertThisInitialized(_this), _setProperty);
67
69
  _classPrivateMethodInitSpec(_assertThisInitialized(_this), _getSubProperty);
68
70
  _classPrivateMethodInitSpec(_assertThisInitialized(_this), _setSubProperty);
@@ -94,6 +96,7 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject) {
94
96
  _defineProperty(_assertThisInitialized(_this), "set", _this.setValue);
95
97
  _defineProperty(_assertThisInitialized(_this), "setTemp", _classPrivateMethodGet(_assertThisInitialized(_this), _setTempProperty, _setTempProperty2));
96
98
  _defineProperty(_assertThisInitialized(_this), "setDefault", _this.setDefaultValue);
99
+ _defineProperty(_assertThisInitialized(_this), "clear", _this.clearDeltaValue);
97
100
  _defineProperty(_assertThisInitialized(_this), "get_managerClass", function () {
98
101
  return null;
99
102
  });
@@ -193,6 +196,11 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject) {
193
196
  value: function setDefaultValue(key, value) {
194
197
  return _classPrivateMethodGet(this, _setDefaultProperty, _setDefaultProperty2).call(this, key, value);
195
198
  }
199
+ }, {
200
+ key: "clearDeltaValue",
201
+ value: function clearDeltaValue(key) {
202
+ return _classPrivateMethodGet(this, _clearDeltaProperty, _clearDeltaProperty2).call(this, key);
203
+ }
196
204
  }, {
197
205
  key: "setSubValue",
198
206
  value:
@@ -847,6 +855,13 @@ function _setProperty2(key, value) {
847
855
  if (!this.__use_delta) this[key] = value; //on noDelta mode, also update the obj
848
856
  return true;
849
857
  }
858
+ function _clearDeltaProperty2(key) {
859
+ if (this.__use_delta) {
860
+ delete this.__delta[key];
861
+ return true;
862
+ }
863
+ return false;
864
+ }
850
865
  function _setDefaultProperty2(key, value) {
851
866
  //@ts-ignore
852
867
  if (this[key] == undefined || this[key] === "" || this[key] === 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/webobject",
3
- "version": "1.3.12",
3
+ "version": "1.3.13",
4
4
  "description": "Stateful object",
5
5
  "author": "Azrideus",
6
6
  "license": "MIT",