@azrico/webobject 1.4.119 → 1.4.120

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.
@@ -56,7 +56,8 @@ export declare class SimpleObject extends MapableObject {
56
56
  set: (key: WriteablePropOf<this>, value: any, sendChanges?: sendChangesType) => Promise<boolean>;
57
57
  setTemp(key: string, value: any, sendChanges?: sendChangesType): Promise<boolean>;
58
58
  clearRefreshFunction(): Promise<void>;
59
- addRefreshFunction(key: string, new_fnc: any): Promise<void>;
59
+ setRefreshFunction(new_fnc: any): Promise<any>;
60
+ addRefreshFunction(new_fnc: any): any;
60
61
  runRefreshFunction(...params: any): Promise<void>;
61
62
  setAll<K extends WriteablePropOf<this>>(setObj: {
62
63
  [key in K]: any;
@@ -46,7 +46,7 @@ var _setProperty = /*#__PURE__*/new WeakSet();
46
46
  var _setDefaultProperty = /*#__PURE__*/new WeakSet();
47
47
  var _getProperty = /*#__PURE__*/new WeakSet();
48
48
  var _setSaveResultObject = /*#__PURE__*/new WeakSet();
49
- var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _clearRefreshFunction, _addRefreshFunction, _runRefreshFunction, _setAll, _setSubValue, _pushValue, _notifyChanged, _reset, _resetAll, _event_run, _event_add, _setTemp2, _delete_cache) {
49
+ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _clearRefreshFunction, _setRefreshFunction, _addRefreshFunction, _runRefreshFunction, _setAll, _setSubValue, _pushValue, _notifyChanged, _reset, _resetAll, _event_run, _event_add, _setTemp2, _delete_cache) {
50
50
  _inherits(SimpleObject, _MapableObject);
51
51
  var _super = _createSuper(SimpleObject);
52
52
  function SimpleObject() {
@@ -223,7 +223,7 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
223
223
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
224
224
  while (1) switch (_context3.prev = _context3.next) {
225
225
  case 0:
226
- this.__refresh_functions = {};
226
+ this.__refresh_functions = undefined;
227
227
  case 1:
228
228
  case "end":
229
229
  return _context3.stop();
@@ -232,28 +232,51 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
232
232
  }))).apply(this, arguments);
233
233
  }
234
234
  }, {
235
- key: "addRefreshFunction",
236
- value: function addRefreshFunction(_x5, _x6) {
237
- return (_addRefreshFunction = _addRefreshFunction || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(key, new_fnc) {
238
- var oldFunctions;
235
+ key: "setRefreshFunction",
236
+ value: function setRefreshFunction(_x5) {
237
+ return (_setRefreshFunction = _setRefreshFunction || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(new_fnc) {
239
238
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
240
239
  while (1) switch (_context4.prev = _context4.next) {
241
240
  case 0:
241
+ _context4.next = 2;
242
+ return this.addRefreshFunction(new_fnc);
243
+ case 2:
244
+ return _context4.abrupt("return", _context4.sent);
245
+ case 3:
246
+ case "end":
247
+ return _context4.stop();
248
+ }
249
+ }, _callee4, this);
250
+ }))).apply(this, arguments);
251
+ }
252
+ }, {
253
+ key: "addRefreshFunction",
254
+ value: function addRefreshFunction(_x6, _x7) {
255
+ return (_addRefreshFunction = _addRefreshFunction || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(key, new_fnc) {
256
+ var oldFunctions;
257
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
258
+ while (1) switch (_context5.prev = _context5.next) {
259
+ case 0:
260
+ if (typeof key === "function") {
261
+ new_fnc = key;
262
+ key = "main";
263
+ }
264
+ key = key || "main";
242
265
  oldFunctions = this.__refresh_functions;
243
266
  if (oldFunctions == null || _typeof(oldFunctions) !== "object") oldFunctions = {};
244
267
  oldFunctions[key] = new_fnc;
245
268
  this.__refresh_functions = oldFunctions;
246
- case 4:
269
+ case 6:
247
270
  case "end":
248
- return _context4.stop();
271
+ return _context5.stop();
249
272
  }
250
- }, _callee4, this);
273
+ }, _callee5, this);
251
274
  }))).apply(this, arguments);
252
275
  }
253
276
  }, {
254
277
  key: "runRefreshFunction",
255
278
  value: function runRefreshFunction() {
256
- return (_runRefreshFunction = _runRefreshFunction || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
279
+ return (_runRefreshFunction = _runRefreshFunction || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
257
280
  var oldFunctions,
258
281
  fncArray,
259
282
  _len,
@@ -261,70 +284,75 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
261
284
  _key,
262
285
  index,
263
286
  fnc,
264
- _args5 = arguments;
265
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
266
- while (1) switch (_context5.prev = _context5.next) {
287
+ _args6 = arguments;
288
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
289
+ while (1) switch (_context6.prev = _context6.next) {
267
290
  case 0:
268
291
  oldFunctions = this.__refresh_functions;
269
- if (oldFunctions == null || _typeof(oldFunctions) !== "object") oldFunctions = {};
292
+ if (!(oldFunctions == null || _typeof(oldFunctions) !== "object")) {
293
+ _context6.next = 3;
294
+ break;
295
+ }
296
+ return _context6.abrupt("return");
297
+ case 3:
270
298
  fncArray = Object.values(oldFunctions);
271
- for (_len = _args5.length, params = new Array(_len), _key = 0; _key < _len; _key++) {
272
- params[_key] = _args5[_key];
299
+ for (_len = _args6.length, params = new Array(_len), _key = 0; _key < _len; _key++) {
300
+ params[_key] = _args6[_key];
273
301
  }
274
302
  index = 0;
275
- case 5:
303
+ case 6:
276
304
  if (!(index < fncArray.length)) {
277
- _context5.next = 12;
305
+ _context6.next = 13;
278
306
  break;
279
307
  }
280
308
  fnc = fncArray[index];
281
- _context5.next = 9;
309
+ _context6.next = 10;
282
310
  return _object.fn_eval.apply(void 0, [fnc].concat(params));
283
- case 9:
311
+ case 10:
284
312
  index++;
285
- _context5.next = 5;
313
+ _context6.next = 6;
286
314
  break;
287
- case 12:
315
+ case 13:
288
316
  case "end":
289
- return _context5.stop();
317
+ return _context6.stop();
290
318
  }
291
- }, _callee5, this);
319
+ }, _callee6, this);
292
320
  }))).apply(this, arguments);
293
321
  } /* -------------------------------------------------------------------------- */
294
322
  }, {
295
323
  key: "setAll",
296
- value: function setAll(_x7) {
297
- return (_setAll = _setAll || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(setObj) {
324
+ value: function setAll(_x8) {
325
+ return (_setAll = _setAll || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(setObj) {
298
326
  var finalRes, key;
299
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
300
- while (1) switch (_context6.prev = _context6.next) {
327
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
328
+ while (1) switch (_context7.prev = _context7.next) {
301
329
  case 0:
302
330
  finalRes = true;
303
- _context6.t0 = _regeneratorRuntime().keys(setObj);
331
+ _context7.t0 = _regeneratorRuntime().keys(setObj);
304
332
  case 2:
305
- if ((_context6.t1 = _context6.t0()).done) {
306
- _context6.next = 10;
333
+ if ((_context7.t1 = _context7.t0()).done) {
334
+ _context7.next = 10;
307
335
  break;
308
336
  }
309
- key = _context6.t1.value;
310
- _context6.next = 6;
337
+ key = _context7.t1.value;
338
+ _context7.next = 6;
311
339
  return this.setValue(key, setObj[key]);
312
340
  case 6:
313
- if (_context6.sent) {
314
- _context6.next = 8;
341
+ if (_context7.sent) {
342
+ _context7.next = 8;
315
343
  break;
316
344
  }
317
345
  finalRes = false;
318
346
  case 8:
319
- _context6.next = 2;
347
+ _context7.next = 2;
320
348
  break;
321
349
  case 10:
322
- return _context6.abrupt("return", finalRes);
350
+ return _context7.abrupt("return", finalRes);
323
351
  case 11:
324
352
  case "end":
325
- return _context6.stop();
353
+ return _context7.stop();
326
354
  }
327
- }, _callee6, this);
355
+ }, _callee7, this);
328
356
  }))).apply(this, arguments);
329
357
  }
330
358
  /**
@@ -348,30 +376,30 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
348
376
  * @param subvalue
349
377
  * @return true if changed , false otherwise
350
378
  */
351
- function setSubValue(_x8, _x9, _x10) {
352
- return (_setSubValue = _setSubValue || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(key, objKey, subvalue) {
379
+ function setSubValue(_x9, _x10, _x11) {
380
+ return (_setSubValue = _setSubValue || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(key, objKey, subvalue) {
353
381
  var sendChanges,
354
382
  isValueChanged,
355
383
  subval,
356
- _args7 = arguments;
357
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
358
- while (1) switch (_context7.prev = _context7.next) {
384
+ _args8 = arguments;
385
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
386
+ while (1) switch (_context8.prev = _context8.next) {
359
387
  case 0:
360
- sendChanges = _args7.length > 3 && _args7[3] !== undefined ? _args7[3] : "auto";
388
+ sendChanges = _args8.length > 3 && _args8[3] !== undefined ? _args8[3] : "auto";
361
389
  if (this.canModify) {
362
- _context7.next = 7;
390
+ _context8.next = 7;
363
391
  break;
364
392
  }
365
393
  if (!(this.__throw_errors !== false)) {
366
- _context7.next = 6;
394
+ _context8.next = 6;
367
395
  break;
368
396
  }
369
397
  throw Error("Cant use setValue when on readonly mode");
370
398
  case 6:
371
- return _context7.abrupt("return", false);
399
+ return _context8.abrupt("return", false);
372
400
  case 7:
373
401
  isValueChanged = false;
374
- _context7.prev = 8;
402
+ _context8.prev = 8;
375
403
  //if accessing subval of an object, make sure the object is not null
376
404
  subval = _classPrivateMethodGet(this, _getSubProperty, _getSubProperty2).call(this, key, objKey);
377
405
  if (!(0, _object.object_equals)(subval, subvalue, {
@@ -382,22 +410,22 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
382
410
  isValueChanged = true;
383
411
  } else isValueChanged = false;
384
412
  case 11:
385
- _context7.prev = 11;
413
+ _context8.prev = 11;
386
414
  if (!(sendChanges === true || sendChanges === "auto" && isValueChanged)) {
387
- _context7.next = 15;
415
+ _context8.next = 15;
388
416
  break;
389
417
  }
390
- _context7.next = 15;
418
+ _context8.next = 15;
391
419
  return this.notifyChanged("", key, objKey, subvalue);
392
420
  case 15:
393
- return _context7.finish(11);
421
+ return _context8.finish(11);
394
422
  case 16:
395
- return _context7.abrupt("return", isValueChanged);
423
+ return _context8.abrupt("return", isValueChanged);
396
424
  case 17:
397
425
  case "end":
398
- return _context7.stop();
426
+ return _context8.stop();
399
427
  }
400
- }, _callee7, this, [[8,, 11, 16]]);
428
+ }, _callee8, this, [[8,, 11, 16]]);
401
429
  }))).apply(this, arguments);
402
430
  }
403
431
  }, {
@@ -410,72 +438,72 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
410
438
  * @param sendChanges
411
439
  * @returns
412
440
  */
413
- function pushValue(_x11, _x12) {
414
- return (_pushValue = _pushValue || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(key, value) {
441
+ function pushValue(_x12, _x13) {
442
+ return (_pushValue = _pushValue || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(key, value) {
415
443
  var sendChanges,
416
444
  tempArray,
417
- _args8 = arguments;
418
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
419
- while (1) switch (_context8.prev = _context8.next) {
445
+ _args9 = arguments;
446
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
447
+ while (1) switch (_context9.prev = _context9.next) {
420
448
  case 0:
421
- sendChanges = _args8.length > 2 && _args8[2] !== undefined ? _args8[2] : "auto";
449
+ sendChanges = _args9.length > 2 && _args9[2] !== undefined ? _args9[2] : "auto";
422
450
  if (!(value == null)) {
423
- _context8.next = 3;
451
+ _context9.next = 3;
424
452
  break;
425
453
  }
426
- return _context8.abrupt("return", false);
454
+ return _context9.abrupt("return", false);
427
455
  case 3:
428
456
  if (this.canModify) {
429
- _context8.next = 9;
457
+ _context9.next = 9;
430
458
  break;
431
459
  }
432
460
  if (!(this.__throw_errors !== false)) {
433
- _context8.next = 8;
461
+ _context9.next = 8;
434
462
  break;
435
463
  }
436
464
  throw Error("Cant use pushValue when on readonly mode");
437
465
  case 8:
438
- return _context8.abrupt("return", false);
466
+ return _context9.abrupt("return", false);
439
467
  case 9:
440
468
  if (_classPrivateMethodGet(this, _getProperty, _getProperty2).call(this, key) == null) {
441
469
  _classPrivateMethodGet(this, _setProperty, _setProperty2).call(this, key, []);
442
470
  }
443
471
  tempArray = _classPrivateMethodGet(this, _getProperty, _getProperty2).call(this, key);
444
472
  if (Array.isArray(tempArray)) {
445
- _context8.next = 17;
473
+ _context9.next = 17;
446
474
  break;
447
475
  }
448
476
  if (!(this.__throw_errors !== false)) {
449
- _context8.next = 16;
477
+ _context9.next = 16;
450
478
  break;
451
479
  }
452
480
  throw Error("Cant use pushValue on non Array keys");
453
481
  case 16:
454
- return _context8.abrupt("return", false);
482
+ return _context9.abrupt("return", false);
455
483
  case 17:
456
484
  _classPrivateMethodGet(this, _setProperty, _setProperty2).call(this, key, [].concat(_toConsumableArray(tempArray), [value]));
457
485
  if (!(sendChanges === true || sendChanges === "auto")) {
458
- _context8.next = 21;
486
+ _context9.next = 21;
459
487
  break;
460
488
  }
461
- _context8.next = 21;
489
+ _context9.next = 21;
462
490
  return this.notifyChanged("", key, value);
463
491
  case 21:
464
- return _context8.abrupt("return", tempArray);
492
+ return _context9.abrupt("return", tempArray);
465
493
  case 22:
466
494
  case "end":
467
- return _context8.stop();
495
+ return _context9.stop();
468
496
  }
469
- }, _callee8, this);
497
+ }, _callee9, this);
470
498
  }))).apply(this, arguments);
471
499
  }
472
500
  }, {
473
501
  key: "notifyChanged",
474
- value: function notifyChanged(_x13, _x14, _x15, _x16) {
475
- return (_notifyChanged = _notifyChanged || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(type, key, value, subvalue) {
502
+ value: function notifyChanged(_x14, _x15, _x16, _x17) {
503
+ return (_notifyChanged = _notifyChanged || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(type, key, value, subvalue) {
476
504
  var lc, manager_class;
477
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
478
- while (1) switch (_context9.prev = _context9.next) {
505
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
506
+ while (1) switch (_context10.prev = _context10.next) {
479
507
  case 0:
480
508
  if (value === undefined && type == "") value = this.getValue(key);
481
509
  this.__changed = true;
@@ -490,16 +518,16 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
490
518
  /* --------------------------- notify the manager --------------------------- */
491
519
  manager_class = this.manager;
492
520
  if (!(manager_class instanceof _ObjectManager["default"])) {
493
- _context9.next = 10;
521
+ _context10.next = 10;
494
522
  break;
495
523
  }
496
- _context9.next = 10;
524
+ _context10.next = 10;
497
525
  return manager_class.notifyChanged(type, key, value, subvalue);
498
526
  case 10:
499
527
  case "end":
500
- return _context9.stop();
528
+ return _context10.stop();
501
529
  }
502
- }, _callee9, this);
530
+ }, _callee10, this);
503
531
  }))).apply(this, arguments);
504
532
  }
505
533
  /**
@@ -563,23 +591,23 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
563
591
  */
564
592
  }, {
565
593
  key: "reset",
566
- value: function reset(_x17) {
567
- return (_reset = _reset || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(key) {
594
+ value: function reset(_x18) {
595
+ return (_reset = _reset || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(key) {
568
596
  var notifyChanged,
569
- _args10 = arguments;
570
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
571
- while (1) switch (_context10.prev = _context10.next) {
597
+ _args11 = arguments;
598
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
599
+ while (1) switch (_context11.prev = _context11.next) {
572
600
  case 0:
573
- notifyChanged = _args10.length > 1 && _args10[1] !== undefined ? _args10[1] : "auto";
574
- _context10.next = 3;
601
+ notifyChanged = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : "auto";
602
+ _context11.next = 3;
575
603
  return this.setValue(key, this[key], notifyChanged);
576
604
  case 3:
577
- return _context10.abrupt("return", _context10.sent);
605
+ return _context11.abrupt("return", _context11.sent);
578
606
  case 4:
579
607
  case "end":
580
- return _context10.stop();
608
+ return _context11.stop();
581
609
  }
582
- }, _callee10, this);
610
+ }, _callee11, this);
583
611
  }))).apply(this, arguments);
584
612
  }
585
613
  /**
@@ -590,43 +618,43 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
590
618
  }, {
591
619
  key: "resetAll",
592
620
  value: function resetAll() {
593
- return (_resetAll = _resetAll || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
621
+ return (_resetAll = _resetAll || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
594
622
  var notifyChanged,
595
623
  fr,
596
624
  key,
597
- _args11 = arguments;
598
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
599
- while (1) switch (_context11.prev = _context11.next) {
625
+ _args12 = arguments;
626
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
627
+ while (1) switch (_context12.prev = _context12.next) {
600
628
  case 0:
601
- notifyChanged = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : "auto";
629
+ notifyChanged = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : "auto";
602
630
  fr = true;
603
- _context11.t0 = _regeneratorRuntime().keys(this.__delta);
631
+ _context12.t0 = _regeneratorRuntime().keys(this.__delta);
604
632
  case 3:
605
- if ((_context11.t1 = _context11.t0()).done) {
606
- _context11.next = 13;
633
+ if ((_context12.t1 = _context12.t0()).done) {
634
+ _context12.next = 13;
607
635
  break;
608
636
  }
609
- key = _context11.t1.value;
610
- _context11.t2 = fr;
611
- if (!_context11.t2) {
612
- _context11.next = 10;
637
+ key = _context12.t1.value;
638
+ _context12.t2 = fr;
639
+ if (!_context12.t2) {
640
+ _context12.next = 10;
613
641
  break;
614
642
  }
615
- _context11.next = 9;
643
+ _context12.next = 9;
616
644
  return this.reset(key, notifyChanged);
617
645
  case 9:
618
- _context11.t2 = _context11.sent;
646
+ _context12.t2 = _context12.sent;
619
647
  case 10:
620
- fr = _context11.t2;
621
- _context11.next = 3;
648
+ fr = _context12.t2;
649
+ _context12.next = 3;
622
650
  break;
623
651
  case 13:
624
- return _context11.abrupt("return", fr);
652
+ return _context12.abrupt("return", fr);
625
653
  case 14:
626
654
  case "end":
627
- return _context11.stop();
655
+ return _context12.stop();
628
656
  }
629
- }, _callee11, this);
657
+ }, _callee12, this);
630
658
  }))).apply(this, arguments);
631
659
  }
632
660
  /**
@@ -798,35 +826,35 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
798
826
  /* -------------------------------------------------------------------------- */
799
827
  /* Events */
800
828
  /* -------------------------------------------------------------------------- */
801
- function event_run(_x18) {
802
- return (_event_run = _event_run || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(eventName) {
829
+ function event_run(_x19) {
830
+ return (_event_run = _event_run || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(eventName) {
803
831
  var _this$manager;
804
832
  var _len2,
805
833
  params,
806
834
  _key2,
807
- _args12 = arguments;
808
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
809
- while (1) switch (_context12.prev = _context12.next) {
835
+ _args13 = arguments;
836
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
837
+ while (1) switch (_context13.prev = _context13.next) {
810
838
  case 0:
811
839
  if (this.manager) {
812
- _context12.next = 3;
840
+ _context13.next = 3;
813
841
  break;
814
842
  }
815
843
  if (this.__showErrors === true) console.error("you cant use events if your object has no manager");
816
- return _context12.abrupt("return");
844
+ return _context13.abrupt("return");
817
845
  case 3:
818
- for (_len2 = _args12.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
819
- params[_key2 - 1] = _args12[_key2];
846
+ for (_len2 = _args13.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
847
+ params[_key2 - 1] = _args13[_key2];
820
848
  }
821
- _context12.next = 6;
849
+ _context13.next = 6;
822
850
  return (_this$manager = this.manager).event_run.apply(_this$manager, [eventName].concat(params));
823
851
  case 6:
824
- return _context12.abrupt("return", _context12.sent);
852
+ return _context13.abrupt("return", _context13.sent);
825
853
  case 7:
826
854
  case "end":
827
- return _context12.stop();
855
+ return _context13.stop();
828
856
  }
829
- }, _callee12, this);
857
+ }, _callee13, this);
830
858
  }))).apply(this, arguments);
831
859
  }
832
860
  }, {
@@ -851,30 +879,30 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
851
879
  }
852
880
  }, {
853
881
  key: "event_add",
854
- value: function event_add(_x19, _x20, _x21) {
855
- return (_event_add = _event_add || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(name, uname, runEvent) {
882
+ value: function event_add(_x20, _x21, _x22) {
883
+ return (_event_add = _event_add || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(name, uname, runEvent) {
856
884
  var onlyOn,
857
885
  runOnce,
858
- _args13 = arguments;
859
- return _regeneratorRuntime().wrap(function _callee13$(_context13) {
860
- while (1) switch (_context13.prev = _context13.next) {
886
+ _args14 = arguments;
887
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
888
+ while (1) switch (_context14.prev = _context14.next) {
861
889
  case 0:
862
- onlyOn = _args13.length > 3 && _args13[3] !== undefined ? _args13[3] : null;
863
- runOnce = _args13.length > 4 && _args13[4] !== undefined ? _args13[4] : false;
890
+ onlyOn = _args14.length > 3 && _args14[3] !== undefined ? _args14[3] : null;
891
+ runOnce = _args14.length > 4 && _args14[4] !== undefined ? _args14[4] : false;
864
892
  if (this.manager) {
865
- _context13.next = 5;
893
+ _context14.next = 5;
866
894
  break;
867
895
  }
868
896
  if (this.__showErrors === true) console.error("you cant use events if your object has no manager");
869
- return _context13.abrupt("return");
897
+ return _context14.abrupt("return");
870
898
  case 5:
871
- _context13.next = 7;
899
+ _context14.next = 7;
872
900
  return this.manager.event_add(name, uname, runEvent, onlyOn, runOnce);
873
901
  case 7:
874
902
  case "end":
875
- return _context13.stop();
903
+ return _context14.stop();
876
904
  }
877
- }, _callee13, this);
905
+ }, _callee14, this);
878
906
  }))).apply(this, arguments);
879
907
  }
880
908
  /* -------------------------------------------------------------------------- */
@@ -1214,37 +1242,37 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
1214
1242
  }
1215
1243
  }, {
1216
1244
  key: "setTemp",
1217
- value: function setTemp(_x22, _x23, _x24) {
1218
- return (_setTemp2 = _setTemp2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(obj, key, value) {
1245
+ value: function setTemp(_x23, _x24, _x25) {
1246
+ return (_setTemp2 = _setTemp2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(obj, key, value) {
1219
1247
  var sendChanges,
1220
- _args14 = arguments;
1221
- return _regeneratorRuntime().wrap(function _callee14$(_context14) {
1222
- while (1) switch (_context14.prev = _context14.next) {
1248
+ _args15 = arguments;
1249
+ return _regeneratorRuntime().wrap(function _callee15$(_context15) {
1250
+ while (1) switch (_context15.prev = _context15.next) {
1223
1251
  case 0:
1224
- sendChanges = _args14.length > 3 && _args14[3] !== undefined ? _args14[3] : false;
1252
+ sendChanges = _args15.length > 3 && _args15[3] !== undefined ? _args15[3] : false;
1225
1253
  if (!(_typeof(obj) !== "object" || !obj || Array.isArray(obj))) {
1226
- _context14.next = 3;
1254
+ _context15.next = 3;
1227
1255
  break;
1228
1256
  }
1229
- return _context14.abrupt("return");
1257
+ return _context15.abrupt("return");
1230
1258
  case 3:
1231
1259
  if (!(obj instanceof SimpleObject)) {
1232
- _context14.next = 7;
1260
+ _context15.next = 7;
1233
1261
  break;
1234
1262
  }
1235
- _context14.next = 6;
1263
+ _context15.next = 6;
1236
1264
  return obj.setTemp(key, value, sendChanges);
1237
1265
  case 6:
1238
- return _context14.abrupt("return", _context14.sent);
1266
+ return _context15.abrupt("return", _context15.sent);
1239
1267
  case 7:
1240
1268
  //
1241
1269
  if (obj.__temp == null) obj.__temp = {};
1242
1270
  (0, _object.object_set)(obj.__temp, key, value);
1243
1271
  case 9:
1244
1272
  case "end":
1245
- return _context14.stop();
1273
+ return _context15.stop();
1246
1274
  }
1247
- }, _callee14);
1275
+ }, _callee15);
1248
1276
  }))).apply(this, arguments);
1249
1277
  }
1250
1278
  }, {
@@ -1255,36 +1283,36 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
1255
1283
  }
1256
1284
  }, {
1257
1285
  key: "delete_cache",
1258
- value: function delete_cache(_x25) {
1259
- return (_delete_cache = _delete_cache || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(context) {
1286
+ value: function delete_cache(_x26) {
1287
+ return (_delete_cache = _delete_cache || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(context) {
1260
1288
  var cacheKey;
1261
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
1262
- while (1) switch (_context15.prev = _context15.next) {
1289
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
1290
+ while (1) switch (_context16.prev = _context16.next) {
1263
1291
  case 0:
1264
1292
  if (this.__cache_name) {
1265
- _context15.next = 2;
1293
+ _context16.next = 2;
1266
1294
  break;
1267
1295
  }
1268
- return _context15.abrupt("return");
1296
+ return _context16.abrupt("return");
1269
1297
  case 2:
1270
1298
  if (context) {
1271
- _context15.next = 7;
1299
+ _context16.next = 7;
1272
1300
  break;
1273
1301
  }
1274
- _context15.next = 5;
1302
+ _context16.next = 5;
1275
1303
  return _global.gcache.delete_session_cache(this.__cache_name);
1276
1304
  case 5:
1277
- _context15.next = 10;
1305
+ _context16.next = 10;
1278
1306
  break;
1279
1307
  case 7:
1280
1308
  cacheKey = "".concat(this.__cache_name, "-").concat(context);
1281
- _context15.next = 10;
1309
+ _context16.next = 10;
1282
1310
  return _global.gcache.delete_session_cache(cacheKey);
1283
1311
  case 10:
1284
1312
  case "end":
1285
- return _context15.stop();
1313
+ return _context16.stop();
1286
1314
  }
1287
- }, _callee15, this);
1315
+ }, _callee16, this);
1288
1316
  }))).apply(this, arguments);
1289
1317
  }
1290
1318
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/webobject",
3
- "version": "1.4.119",
3
+ "version": "1.4.120",
4
4
  "description": "Stateful object",
5
5
  "author": "Azrideus",
6
6
  "license": "MIT",