@azrico/webobject 1.4.123 → 1.4.124

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.
@@ -69,6 +69,13 @@ export declare class SimpleObject extends MapableObject {
69
69
  * @returns
70
70
  */
71
71
  setDefaultValue(key: WriteablePropOf<this>, value: any): boolean;
72
+ /**
73
+ * set value of a key to now date time
74
+ * @param key
75
+ * @param value
76
+ * @returns
77
+ */
78
+ setDefaultValueNow: (key: PropOf<this>) => boolean;
72
79
  /**
73
80
  * set value of a key only if the value is empty (null,undef,"")
74
81
  * @param key
@@ -38,6 +38,7 @@ var _setSubProperty = /*#__PURE__*/new WeakSet();
38
38
  var _getSubProperty = /*#__PURE__*/new WeakSet();
39
39
  var _setProperty = /*#__PURE__*/new WeakSet();
40
40
  var _setDefaultProperty = /*#__PURE__*/new WeakSet();
41
+ var _setDefaultPropertyNow = /*#__PURE__*/new WeakSet();
41
42
  var _getProperty = /*#__PURE__*/new WeakSet();
42
43
  var _setSaveResultObject = /*#__PURE__*/new WeakSet();
43
44
  var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _clearRefreshFunction, _setRefreshFunction, _addRefreshFunction, _runRefreshFunction, _setAll, _setSubValue, _pushValue, _pushValues, _notifyChanged, _reset, _resetAll, _event_run, _event_add, _setTemp2, _delete_cache) {
@@ -54,6 +55,7 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
54
55
  */
55
56
  _classPrivateMethodInitSpec(_assertThisInitialized(_this), _setSaveResultObject);
56
57
  _classPrivateMethodInitSpec(_assertThisInitialized(_this), _getProperty);
58
+ _classPrivateMethodInitSpec(_assertThisInitialized(_this), _setDefaultPropertyNow);
57
59
  _classPrivateMethodInitSpec(_assertThisInitialized(_this), _setDefaultProperty);
58
60
  _classPrivateMethodInitSpec(_assertThisInitialized(_this), _setProperty);
59
61
  _classPrivateMethodInitSpec(_assertThisInitialized(_this), _getSubProperty);
@@ -90,6 +92,13 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
90
92
  _defineProperty(_assertThisInitialized(_this), "getValue", _classPrivateMethodGet(_assertThisInitialized(_this), _getProperty, _getProperty2));
91
93
  _defineProperty(_assertThisInitialized(_this), "get", _classPrivateMethodGet(_assertThisInitialized(_this), _getProperty, _getProperty2));
92
94
  _defineProperty(_assertThisInitialized(_this), "set", _this.setValue);
95
+ /**
96
+ * set value of a key to now date time
97
+ * @param key
98
+ * @param value
99
+ * @returns
100
+ */
101
+ _defineProperty(_assertThisInitialized(_this), "setDefaultValueNow", _classPrivateMethodGet(_assertThisInitialized(_this), _setDefaultPropertyNow, _setDefaultPropertyNow2));
93
102
  /**
94
103
  * set value of a key only if the value is empty (null,undef,"")
95
104
  * @param key
@@ -1392,6 +1401,14 @@ function _setDefaultProperty2(key, value) {
1392
1401
  }
1393
1402
  return false;
1394
1403
  }
1404
+ function _setDefaultPropertyNow2(key) {
1405
+ //@ts-ignore
1406
+ if (this[key] == undefined || this[key] === "" || this[key] === 0) {
1407
+ this[key] = new Date();
1408
+ return true;
1409
+ }
1410
+ return false;
1411
+ }
1395
1412
  function _getProperty2(key) {
1396
1413
  var original = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1397
1414
  //check if we should treat the prop as a function
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/webobject",
3
- "version": "1.4.123",
3
+ "version": "1.4.124",
4
4
  "description": "Stateful object",
5
5
  "author": "Azrideus",
6
6
  "license": "MIT",