@azrico/webobject 1.3.16 → 1.3.18

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,7 @@ export declare class WebObject extends SimpleObject {
69
69
  static get_webname(): string | undefined;
70
70
  get manager(): WebObjectManager<any> | null;
71
71
  get_managerClass: () => WebObjectManager<any> | null;
72
+ set_managerClass(mng: WebObjectManager<any> | any): void;
72
73
  onDelete(...p: any): Promise<any>;
73
74
  onLoad(...p: any): Promise<any>;
74
75
  onSave(...p: any): Promise<any>;
@@ -343,9 +343,17 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
343
343
  get: function get() {
344
344
  return this.get_managerClass();
345
345
  }
346
+ }, {
347
+ key: "set_managerClass",
348
+ value: function set_managerClass(mng) {
349
+ this.get_managerClass = function () {
350
+ return mng;
351
+ };
352
+ }
353
+ /* -------------------------------------------------------------------------- */
346
354
  }, {
347
355
  key: "onDelete",
348
- value: /* -------------------------------------------------------------------------- */function () {
356
+ value: function () {
349
357
  var _onDelete = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
350
358
  var _this$manager;
351
359
  var _len,
@@ -95,6 +95,9 @@ var ObjectManager = /*#__PURE__*/function () {
95
95
  return _this;
96
96
  };
97
97
  }
98
+ if (toObj == null) {
99
+ console.warn("setObject was used to set null. try to use empty objects instead of null");
100
+ }
98
101
  return true;
99
102
  }
100
103
  /* -------------------------------------------------------------------------- */
@@ -168,7 +171,10 @@ var ObjectManager = /*#__PURE__*/function () {
168
171
  value: function getValue(key) {
169
172
  var original = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
170
173
  var thisobj = this.obj;
171
- if (thisobj == null || typeof thisobj.getValue != "function") return null;
174
+ if (thisobj == null || typeof thisobj.getValue != "function") {
175
+ console.error("cant use getValue when object is not defined. maybe you have to use New() ?");
176
+ return null;
177
+ }
172
178
  return thisobj.getValue(key, original);
173
179
  }
174
180
  }, {
@@ -188,23 +194,24 @@ var ObjectManager = /*#__PURE__*/function () {
188
194
  case 0:
189
195
  thisobj = this.obj;
190
196
  if (!(thisobj == null || typeof thisobj.setValue != "function")) {
191
- _context2.next = 3;
197
+ _context2.next = 4;
192
198
  break;
193
199
  }
200
+ console.error("cant use setValue when object is not defined. maybe you have to use New() ?");
194
201
  return _context2.abrupt("return", false);
195
- case 3:
196
- _context2.next = 5;
202
+ case 4:
203
+ _context2.next = 6;
197
204
  return thisobj.setValue(key, value);
198
- case 5:
205
+ case 6:
199
206
  _context2.t0 = _context2.sent;
200
207
  if (_context2.t0) {
201
- _context2.next = 8;
208
+ _context2.next = 9;
202
209
  break;
203
210
  }
204
211
  _context2.t0 = false;
205
- case 8:
206
- return _context2.abrupt("return", _context2.t0);
207
212
  case 9:
213
+ return _context2.abrupt("return", _context2.t0);
214
+ case 10:
208
215
  case "end":
209
216
  return _context2.stop();
210
217
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/webobject",
3
- "version": "1.3.16",
3
+ "version": "1.3.18",
4
4
  "description": "Stateful object",
5
5
  "author": "Azrideus",
6
6
  "license": "MIT",