@azrico/webobject 1.4.63 → 1.4.64

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,6 +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): Promise<any>;
57
+ getTemp(key: string): Promise<any>;
57
58
  getIndexOrID(): number | string;
58
59
  getIndex(): number;
59
60
  getID(): string;
@@ -317,24 +317,54 @@ var ObjectManager = /*#__PURE__*/function () {
317
317
  return _setTemp.apply(this, arguments);
318
318
  }
319
319
  return setTemp;
320
+ }() //get temp value
321
+ }, {
322
+ key: "getTemp",
323
+ value: function () {
324
+ var _getTemp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(key) {
325
+ var _this$obj9;
326
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
327
+ while (1) switch (_context6.prev = _context6.next) {
328
+ case 0:
329
+ _context6.next = 2;
330
+ return (_this$obj9 = this.obj) === null || _this$obj9 === void 0 ? void 0 : _this$obj9.getTemp(key);
331
+ case 2:
332
+ _context6.t0 = _context6.sent;
333
+ if (_context6.t0) {
334
+ _context6.next = 5;
335
+ break;
336
+ }
337
+ _context6.t0 = false;
338
+ case 5:
339
+ return _context6.abrupt("return", _context6.t0);
340
+ case 6:
341
+ case "end":
342
+ return _context6.stop();
343
+ }
344
+ }, _callee6, this);
345
+ }));
346
+ function getTemp(_x14) {
347
+ return _getTemp.apply(this, arguments);
348
+ }
349
+ return getTemp;
320
350
  }() /* -------------------------------------------------------------------------- */
321
351
  }, {
322
352
  key: "getIndexOrID",
323
353
  value: function getIndexOrID() {
324
- var _this$obj9;
325
- return ((_this$obj9 = this.obj) === null || _this$obj9 === void 0 ? void 0 : _this$obj9.getIndexOrID()) || -1;
354
+ var _this$obj10;
355
+ return ((_this$obj10 = this.obj) === null || _this$obj10 === void 0 ? void 0 : _this$obj10.getIndexOrID()) || -1;
326
356
  }
327
357
  }, {
328
358
  key: "getIndex",
329
359
  value: function getIndex() {
330
- var _this$obj10;
331
- return ((_this$obj10 = this.obj) === null || _this$obj10 === void 0 ? void 0 : _this$obj10.getIndex()) || -1;
360
+ var _this$obj11;
361
+ return ((_this$obj11 = this.obj) === null || _this$obj11 === void 0 ? void 0 : _this$obj11.getIndex()) || -1;
332
362
  }
333
363
  }, {
334
364
  key: "getID",
335
365
  value: function getID() {
336
- var _this$obj11;
337
- return ((_this$obj11 = this.obj) === null || _this$obj11 === void 0 ? void 0 : _this$obj11.getID()) || "";
366
+ var _this$obj12;
367
+ return ((_this$obj12 = this.obj) === null || _this$obj12 === void 0 ? void 0 : _this$obj12.getID()) || "";
338
368
  }
339
369
  /* -------------------------------------------------------------------------- */
340
370
  /* Events */
@@ -342,34 +372,34 @@ var ObjectManager = /*#__PURE__*/function () {
342
372
  }, {
343
373
  key: "event_run",
344
374
  value: function () {
345
- var _event_run = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(eventName) {
375
+ var _event_run = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(eventName) {
346
376
  var _len,
347
377
  params,
348
378
  _key,
349
- _args6 = arguments;
350
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
351
- while (1) switch (_context6.prev = _context6.next) {
379
+ _args7 = arguments;
380
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
381
+ while (1) switch (_context7.prev = _context7.next) {
352
382
  case 0:
353
383
  if (!(this.__stopEvents === true)) {
354
- _context6.next = 2;
384
+ _context7.next = 2;
355
385
  break;
356
386
  }
357
- return _context6.abrupt("return");
387
+ return _context7.abrupt("return");
358
388
  case 2:
359
- for (_len = _args6.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
360
- params[_key - 1] = _args6[_key];
389
+ for (_len = _args7.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
390
+ params[_key - 1] = _args7[_key];
361
391
  }
362
- _context6.next = 5;
392
+ _context7.next = 5;
363
393
  return _event.EventManager.run.apply(_event.EventManager, [this, eventName].concat(params));
364
394
  case 5:
365
- return _context6.abrupt("return", _context6.sent);
395
+ return _context7.abrupt("return", _context7.sent);
366
396
  case 6:
367
397
  case "end":
368
- return _context6.stop();
398
+ return _context7.stop();
369
399
  }
370
- }, _callee6, this);
400
+ }, _callee7, this);
371
401
  }));
372
- function event_run(_x14) {
402
+ function event_run(_x15) {
373
403
  return _event_run.apply(this, arguments);
374
404
  }
375
405
  return event_run;
@@ -402,24 +432,24 @@ var ObjectManager = /*#__PURE__*/function () {
402
432
  }, {
403
433
  key: "event_add",
404
434
  value: function () {
405
- var _event_add = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(name, uname, runEvent) {
435
+ var _event_add = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(name, uname, runEvent) {
406
436
  var onlyOn,
407
437
  runOnce,
408
- _args7 = arguments;
409
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
410
- while (1) switch (_context7.prev = _context7.next) {
438
+ _args8 = arguments;
439
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
440
+ while (1) switch (_context8.prev = _context8.next) {
411
441
  case 0:
412
- onlyOn = _args7.length > 3 && _args7[3] !== undefined ? _args7[3] : null;
413
- runOnce = _args7.length > 4 && _args7[4] !== undefined ? _args7[4] : false;
414
- _context7.next = 4;
442
+ onlyOn = _args8.length > 3 && _args8[3] !== undefined ? _args8[3] : null;
443
+ runOnce = _args8.length > 4 && _args8[4] !== undefined ? _args8[4] : false;
444
+ _context8.next = 4;
415
445
  return _event.EventManager.add(this, name, uname, runEvent, onlyOn, runOnce);
416
446
  case 4:
417
447
  case "end":
418
- return _context7.stop();
448
+ return _context8.stop();
419
449
  }
420
- }, _callee7, this);
450
+ }, _callee8, this);
421
451
  }));
422
- function event_add(_x15, _x16, _x17) {
452
+ function event_add(_x16, _x17, _x18) {
423
453
  return _event_add.apply(this, arguments);
424
454
  }
425
455
  return event_add;
@@ -442,14 +472,14 @@ var ObjectManager = /*#__PURE__*/function () {
442
472
  }, {
443
473
  key: "clear_changes",
444
474
  value: function clear_changes() {
445
- var _this$obj12;
446
- return (_this$obj12 = this.obj) === null || _this$obj12 === void 0 ? void 0 : _this$obj12.clear_changes();
475
+ var _this$obj13;
476
+ return (_this$obj13 = this.obj) === null || _this$obj13 === void 0 ? void 0 : _this$obj13.clear_changes();
447
477
  }
448
478
  }, {
449
479
  key: "clear_cache",
450
480
  value: function clear_cache() {
451
- var _this$obj13;
452
- return (_this$obj13 = this.obj) === null || _this$obj13 === void 0 ? void 0 : _this$obj13.clear_cache();
481
+ var _this$obj14;
482
+ return (_this$obj14 = this.obj) === null || _this$obj14 === void 0 ? void 0 : _this$obj14.clear_cache();
453
483
  }
454
484
  }, {
455
485
  key: "toggleOption",
@@ -464,31 +494,31 @@ var ObjectManager = /*#__PURE__*/function () {
464
494
  * @returns
465
495
  */
466
496
  function () {
467
- var _toggleOption = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(key, value) {
497
+ var _toggleOption = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(key, value) {
468
498
  var oldval;
469
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
470
- while (1) switch (_context8.prev = _context8.next) {
499
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
500
+ while (1) switch (_context9.prev = _context9.next) {
471
501
  case 0:
472
502
  oldval = this.getOption(key);
473
503
  if (!(0, _object.object_equals_loose)(oldval, value)) {
474
- _context8.next = 6;
504
+ _context9.next = 6;
475
505
  break;
476
506
  }
477
- _context8.next = 4;
507
+ _context9.next = 4;
478
508
  return this.setOption(key, null);
479
509
  case 4:
480
- _context8.next = 8;
510
+ _context9.next = 8;
481
511
  break;
482
512
  case 6:
483
- _context8.next = 8;
513
+ _context9.next = 8;
484
514
  return this.setOption(key, value);
485
515
  case 8:
486
516
  case "end":
487
- return _context8.stop();
517
+ return _context9.stop();
488
518
  }
489
- }, _callee8, this);
519
+ }, _callee9, this);
490
520
  }));
491
- function toggleOption(_x18, _x19) {
521
+ function toggleOption(_x19, _x20) {
492
522
  return _toggleOption.apply(this, arguments);
493
523
  }
494
524
  return toggleOption;
@@ -496,9 +526,9 @@ var ObjectManager = /*#__PURE__*/function () {
496
526
  }, {
497
527
  key: "setOption",
498
528
  value: function () {
499
- var _setOption = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(key, value) {
500
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
501
- while (1) switch (_context9.prev = _context9.next) {
529
+ var _setOption = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(key, value) {
530
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
531
+ while (1) switch (_context10.prev = _context10.next) {
502
532
  case 0:
503
533
  if (this.__options == null) this.__options = {};
504
534
  if (value == null) {
@@ -506,17 +536,17 @@ var ObjectManager = /*#__PURE__*/function () {
506
536
  } else {
507
537
  this.__options[key] = value;
508
538
  }
509
- _context9.next = 4;
539
+ _context10.next = 4;
510
540
  return this.event_run("on_option_change", key, value);
511
541
  case 4:
512
- return _context9.abrupt("return", _context9.sent);
542
+ return _context10.abrupt("return", _context10.sent);
513
543
  case 5:
514
544
  case "end":
515
- return _context9.stop();
545
+ return _context10.stop();
516
546
  }
517
- }, _callee9, this);
547
+ }, _callee10, this);
518
548
  }));
519
- function setOption(_x20, _x21) {
549
+ function setOption(_x21, _x22) {
520
550
  return _setOption.apply(this, arguments);
521
551
  }
522
552
  return setOption;
@@ -545,29 +575,29 @@ var ObjectManager = /*#__PURE__*/function () {
545
575
  }, {
546
576
  key: "holdOption",
547
577
  value: function () {
548
- var _holdOption = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(key, value, nextvalue, action) {
549
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
550
- while (1) switch (_context10.prev = _context10.next) {
578
+ var _holdOption = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(key, value, nextvalue, action) {
579
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
580
+ while (1) switch (_context11.prev = _context11.next) {
551
581
  case 0:
552
- _context10.prev = 0;
582
+ _context11.prev = 0;
553
583
  this.setOption(key, value);
554
584
  if (!(typeof action === "function")) {
555
- _context10.next = 5;
585
+ _context11.next = 5;
556
586
  break;
557
587
  }
558
- _context10.next = 5;
588
+ _context11.next = 5;
559
589
  return action();
560
590
  case 5:
561
- _context10.prev = 5;
591
+ _context11.prev = 5;
562
592
  this.setOption(key, nextvalue);
563
- return _context10.finish(5);
593
+ return _context11.finish(5);
564
594
  case 8:
565
595
  case "end":
566
- return _context10.stop();
596
+ return _context11.stop();
567
597
  }
568
- }, _callee10, this, [[0,, 5, 8]]);
598
+ }, _callee11, this, [[0,, 5, 8]]);
569
599
  }));
570
- function holdOption(_x22, _x23, _x24, _x25) {
600
+ function holdOption(_x23, _x24, _x25, _x26) {
571
601
  return _holdOption.apply(this, arguments);
572
602
  }
573
603
  return holdOption;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/webobject",
3
- "version": "1.4.63",
3
+ "version": "1.4.64",
4
4
  "description": "Stateful object",
5
5
  "author": "Azrideus",
6
6
  "license": "MIT",