@azrico/webobject 1.4.74 → 1.4.75

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.
@@ -54,7 +54,7 @@ export declare class ObjectManager<ObjType extends SimpleObject> {
54
54
  setSubValue(key: PropOf<ObjType>, objKey: string, subvalue: any): Promise<boolean>;
55
55
  pushValue(key: PropOf<ObjType>, value: any): Promise<false | NonNullable<Awaited<ObjType[any]>>>;
56
56
  setTemp(key: string, value: any, sendChanges?: sendChangesType): Promise<boolean>;
57
- getTemp(key: string): Promise<any>;
57
+ getTemp(key: string): any;
58
58
  getIndexOrID(): number | string;
59
59
  getIndex(): number;
60
60
  getID(): string;
@@ -23,7 +23,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
23
23
  /**
24
24
  * This class manages the events of an Simple Object
25
25
  */
26
- var ObjectManager = /*#__PURE__*/function (_notifyChanged, _setValue, _setSubValue, _pushValue, _setTemp, _getTemp, _event_run, _event_add, _toggleOption, _setOption, _holdOption) {
26
+ var ObjectManager = /*#__PURE__*/function (_notifyChanged, _setValue, _setSubValue, _pushValue, _setTemp, _event_run, _event_add, _toggleOption, _setOption, _holdOption) {
27
27
  function ObjectManager() {
28
28
  _classCallCheck(this, ObjectManager);
29
29
  _defineProperty(this, "__eventList", void 0);
@@ -303,30 +303,11 @@ var ObjectManager = /*#__PURE__*/function (_notifyChanged, _setValue, _setSubVal
303
303
  } //get temp value
304
304
  }, {
305
305
  key: "getTemp",
306
- value: function getTemp(_x14) {
307
- return (_getTemp = _getTemp || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(key) {
308
- var _this$obj9;
309
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
310
- while (1) switch (_context6.prev = _context6.next) {
311
- case 0:
312
- _context6.next = 2;
313
- return (_this$obj9 = this.obj) === null || _this$obj9 === void 0 ? void 0 : _this$obj9.getTemp(key);
314
- case 2:
315
- _context6.t0 = _context6.sent;
316
- if (_context6.t0) {
317
- _context6.next = 5;
318
- break;
319
- }
320
- _context6.t0 = false;
321
- case 5:
322
- return _context6.abrupt("return", _context6.t0);
323
- case 6:
324
- case "end":
325
- return _context6.stop();
326
- }
327
- }, _callee6, this);
328
- }))).apply(this, arguments);
329
- } /* -------------------------------------------------------------------------- */
306
+ value: function getTemp(key) {
307
+ var _this$obj9;
308
+ return ((_this$obj9 = this.obj) === null || _this$obj9 === void 0 ? void 0 : _this$obj9.getTemp(key)) || false;
309
+ }
310
+ /* -------------------------------------------------------------------------- */
330
311
  }, {
331
312
  key: "getIndexOrID",
332
313
  value: function getIndexOrID() {
@@ -350,33 +331,33 @@ var ObjectManager = /*#__PURE__*/function (_notifyChanged, _setValue, _setSubVal
350
331
  /* -------------------------------------------------------------------------- */
351
332
  }, {
352
333
  key: "event_run",
353
- value: function event_run(_x15) {
354
- return (_event_run = _event_run || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(eventName) {
334
+ value: function event_run(_x14) {
335
+ return (_event_run = _event_run || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(eventName) {
355
336
  var _len,
356
337
  params,
357
338
  _key,
358
- _args7 = arguments;
359
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
360
- while (1) switch (_context7.prev = _context7.next) {
339
+ _args6 = arguments;
340
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
341
+ while (1) switch (_context6.prev = _context6.next) {
361
342
  case 0:
362
343
  if (!(this.__stopEvents === true)) {
363
- _context7.next = 2;
344
+ _context6.next = 2;
364
345
  break;
365
346
  }
366
- return _context7.abrupt("return");
347
+ return _context6.abrupt("return");
367
348
  case 2:
368
- for (_len = _args7.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
369
- params[_key - 1] = _args7[_key];
349
+ for (_len = _args6.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
350
+ params[_key - 1] = _args6[_key];
370
351
  }
371
- _context7.next = 5;
352
+ _context6.next = 5;
372
353
  return _event.EventManager.run.apply(_event.EventManager, [this, eventName].concat(params));
373
354
  case 5:
374
- return _context7.abrupt("return", _context7.sent);
355
+ return _context6.abrupt("return", _context6.sent);
375
356
  case 6:
376
357
  case "end":
377
- return _context7.stop();
358
+ return _context6.stop();
378
359
  }
379
- }, _callee7, this);
360
+ }, _callee6, this);
380
361
  }))).apply(this, arguments);
381
362
  }
382
363
  }, {
@@ -406,23 +387,23 @@ var ObjectManager = /*#__PURE__*/function (_notifyChanged, _setValue, _setSubVal
406
387
  }
407
388
  }, {
408
389
  key: "event_add",
409
- value: function event_add(_x16, _x17, _x18) {
410
- return (_event_add = _event_add || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(name, uname, runEvent) {
390
+ value: function event_add(_x15, _x16, _x17) {
391
+ return (_event_add = _event_add || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(name, uname, runEvent) {
411
392
  var onlyOn,
412
393
  runOnce,
413
- _args8 = arguments;
414
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
415
- while (1) switch (_context8.prev = _context8.next) {
394
+ _args7 = arguments;
395
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
396
+ while (1) switch (_context7.prev = _context7.next) {
416
397
  case 0:
417
- onlyOn = _args8.length > 3 && _args8[3] !== undefined ? _args8[3] : null;
418
- runOnce = _args8.length > 4 && _args8[4] !== undefined ? _args8[4] : false;
419
- _context8.next = 4;
398
+ onlyOn = _args7.length > 3 && _args7[3] !== undefined ? _args7[3] : null;
399
+ runOnce = _args7.length > 4 && _args7[4] !== undefined ? _args7[4] : false;
400
+ _context7.next = 4;
420
401
  return _event.EventManager.add(this, name, uname, runEvent, onlyOn, runOnce);
421
402
  case 4:
422
403
  case "end":
423
- return _context8.stop();
404
+ return _context7.stop();
424
405
  }
425
- }, _callee8, this);
406
+ }, _callee7, this);
426
407
  }))).apply(this, arguments);
427
408
  }
428
409
  }, {
@@ -464,38 +445,38 @@ var ObjectManager = /*#__PURE__*/function (_notifyChanged, _setValue, _setSubVal
464
445
  * @param value
465
446
  * @returns
466
447
  */
467
- function toggleOption(_x19, _x20) {
468
- return (_toggleOption = _toggleOption || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(key, value) {
448
+ function toggleOption(_x18, _x19) {
449
+ return (_toggleOption = _toggleOption || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(key, value) {
469
450
  var oldval;
470
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
471
- while (1) switch (_context9.prev = _context9.next) {
451
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
452
+ while (1) switch (_context8.prev = _context8.next) {
472
453
  case 0:
473
454
  oldval = this.getOption(key);
474
455
  if (!(0, _object.object_equals_loose)(oldval, value)) {
475
- _context9.next = 6;
456
+ _context8.next = 6;
476
457
  break;
477
458
  }
478
- _context9.next = 4;
459
+ _context8.next = 4;
479
460
  return this.setOption(key, null);
480
461
  case 4:
481
- _context9.next = 8;
462
+ _context8.next = 8;
482
463
  break;
483
464
  case 6:
484
- _context9.next = 8;
465
+ _context8.next = 8;
485
466
  return this.setOption(key, value);
486
467
  case 8:
487
468
  case "end":
488
- return _context9.stop();
469
+ return _context8.stop();
489
470
  }
490
- }, _callee9, this);
471
+ }, _callee8, this);
491
472
  }))).apply(this, arguments);
492
473
  }
493
474
  }, {
494
475
  key: "setOption",
495
- value: function setOption(_x21, _x22) {
496
- return (_setOption = _setOption || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(key, value) {
497
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
498
- while (1) switch (_context10.prev = _context10.next) {
476
+ value: function setOption(_x20, _x21) {
477
+ return (_setOption = _setOption || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(key, value) {
478
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
479
+ while (1) switch (_context9.prev = _context9.next) {
499
480
  case 0:
500
481
  if (this.__options == null) this.__options = {};
501
482
  if (value == null) {
@@ -503,15 +484,15 @@ var ObjectManager = /*#__PURE__*/function (_notifyChanged, _setValue, _setSubVal
503
484
  } else {
504
485
  this.__options[key] = value;
505
486
  }
506
- _context10.next = 4;
487
+ _context9.next = 4;
507
488
  return this.event_run("on_option_change", key, value);
508
489
  case 4:
509
- return _context10.abrupt("return", _context10.sent);
490
+ return _context9.abrupt("return", _context9.sent);
510
491
  case 5:
511
492
  case "end":
512
- return _context10.stop();
493
+ return _context9.stop();
513
494
  }
514
- }, _callee10, this);
495
+ }, _callee9, this);
515
496
  }))).apply(this, arguments);
516
497
  }
517
498
  /**
@@ -537,28 +518,28 @@ var ObjectManager = /*#__PURE__*/function (_notifyChanged, _setValue, _setSubVal
537
518
  */
538
519
  }, {
539
520
  key: "holdOption",
540
- value: function holdOption(_x23, _x24, _x25, _x26) {
541
- return (_holdOption = _holdOption || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(key, value, nextvalue, action) {
542
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
543
- while (1) switch (_context11.prev = _context11.next) {
521
+ value: function holdOption(_x22, _x23, _x24, _x25) {
522
+ return (_holdOption = _holdOption || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(key, value, nextvalue, action) {
523
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
524
+ while (1) switch (_context10.prev = _context10.next) {
544
525
  case 0:
545
- _context11.prev = 0;
526
+ _context10.prev = 0;
546
527
  this.setOption(key, value);
547
528
  if (!(typeof action === "function")) {
548
- _context11.next = 5;
529
+ _context10.next = 5;
549
530
  break;
550
531
  }
551
- _context11.next = 5;
532
+ _context10.next = 5;
552
533
  return action();
553
534
  case 5:
554
- _context11.prev = 5;
535
+ _context10.prev = 5;
555
536
  this.setOption(key, nextvalue);
556
- return _context11.finish(5);
537
+ return _context10.finish(5);
557
538
  case 8:
558
539
  case "end":
559
- return _context11.stop();
540
+ return _context10.stop();
560
541
  }
561
- }, _callee11, this, [[0,, 5, 8]]);
542
+ }, _callee10, this, [[0,, 5, 8]]);
562
543
  }))).apply(this, arguments);
563
544
  }
564
545
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/webobject",
3
- "version": "1.4.74",
3
+ "version": "1.4.75",
4
4
  "description": "Stateful object",
5
5
  "author": "Azrideus",
6
6
  "license": "MIT",