mol_plot_all 1.2.245 → 1.2.246

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.
package/node.test.js CHANGED
@@ -232,6 +232,8 @@ var $node = new Proxy({ require }, {
232
232
  const mod = target.require('module');
233
233
  if (mod.builtinModules.indexOf(name) >= 0)
234
234
  return target.require(name);
235
+ if (name[0] === '.')
236
+ return target.require(name);
235
237
  const path = target.require('path');
236
238
  const fs = target.require('fs');
237
239
  let dir = path.resolve('.');
@@ -2107,7 +2109,12 @@ var $;
2107
2109
  fiber = temp(obj, args);
2108
2110
  return fiber.async();
2109
2111
  };
2110
- }
2112
+ },
2113
+ apply(obj, self, args) {
2114
+ const temp = $mol_wire_task.getter(obj);
2115
+ const fiber = temp(self, args);
2116
+ return fiber.async();
2117
+ },
2111
2118
  });
2112
2119
  }
2113
2120
  $.$mol_wire_async = $mol_wire_async;
@@ -6577,6 +6584,78 @@ var $;
6577
6584
  ;
6578
6585
  "use strict";
6579
6586
  var $;
6587
+ (function ($) {
6588
+ function $mol_promise() {
6589
+ let done;
6590
+ let fail;
6591
+ const promise = new Promise((d, f) => {
6592
+ done = d;
6593
+ fail = f;
6594
+ });
6595
+ return Object.assign(promise, {
6596
+ done,
6597
+ fail,
6598
+ });
6599
+ }
6600
+ $.$mol_promise = $mol_promise;
6601
+ })($ || ($ = {}));
6602
+ //mol/promise/promise.ts
6603
+ ;
6604
+ "use strict";
6605
+ var $;
6606
+ (function ($_1) {
6607
+ $mol_test_mocks.push($ => {
6608
+ $.$mol_after_timeout = $mol_after_mock_timeout;
6609
+ });
6610
+ })($ || ($ = {}));
6611
+ //mol/after/timeout/timeout.test.ts
6612
+ ;
6613
+ "use strict";
6614
+ var $;
6615
+ (function ($) {
6616
+ function $mol_wire_sync(obj) {
6617
+ return new Proxy(obj, {
6618
+ get(obj, field) {
6619
+ const val = obj[field];
6620
+ if (typeof val !== 'function')
6621
+ return val;
6622
+ const temp = $mol_wire_task.getter(val);
6623
+ return function $mol_wire_sync(...args) {
6624
+ const fiber = temp(obj, args);
6625
+ return fiber.sync();
6626
+ };
6627
+ },
6628
+ apply(obj, self, args) {
6629
+ const temp = $mol_wire_task.getter(obj);
6630
+ const fiber = temp(self, args);
6631
+ return fiber.sync();
6632
+ },
6633
+ });
6634
+ }
6635
+ $.$mol_wire_sync = $mol_wire_sync;
6636
+ })($ || ($ = {}));
6637
+ //mol/wire/sync/sync.ts
6638
+ ;
6639
+ "use strict";
6640
+ var $;
6641
+ (function ($) {
6642
+ function $mol_wait_timeout_async(timeout) {
6643
+ const promise = $mol_promise();
6644
+ const task = new this.$mol_after_timeout(timeout, () => promise.done());
6645
+ return Object.assign(promise, {
6646
+ destructor: () => task.destructor()
6647
+ });
6648
+ }
6649
+ $.$mol_wait_timeout_async = $mol_wait_timeout_async;
6650
+ function $mol_wait_timeout(timeout) {
6651
+ return this.$mol_wire_sync(this).$mol_wait_timeout_async(timeout);
6652
+ }
6653
+ $.$mol_wait_timeout = $mol_wait_timeout;
6654
+ })($ || ($ = {}));
6655
+ //mol/wait/timeout/timeout.ts
6656
+ ;
6657
+ "use strict";
6658
+ var $;
6580
6659
  (function ($_1) {
6581
6660
  $mol_test({
6582
6661
  async 'Latest Calls Wins on Concurrency'($) {
@@ -6598,6 +6677,15 @@ var $;
6598
6677
  $mol_assert_like(NameLogger.first, ['john', 'jin']);
6599
6678
  $mol_assert_like(NameLogger.last, ['jin']);
6600
6679
  },
6680
+ async 'Wrap function'($) {
6681
+ const name = $mol_wire_async(function (name) {
6682
+ $.$mol_wait_timeout(0);
6683
+ return name;
6684
+ });
6685
+ const promise = name('jin');
6686
+ $.$mol_after_mock_warp();
6687
+ $mol_assert_like(await promise, 'jin');
6688
+ },
6601
6689
  });
6602
6690
  })($ || ($ = {}));
6603
6691
  //mol/wire/async/async.test.ts
@@ -6662,15 +6750,6 @@ var $;
6662
6750
  ;
6663
6751
  "use strict";
6664
6752
  var $;
6665
- (function ($_1) {
6666
- $mol_test_mocks.push($ => {
6667
- $.$mol_after_timeout = $mol_after_mock_timeout;
6668
- });
6669
- })($ || ($ = {}));
6670
- //mol/after/timeout/timeout.test.ts
6671
- ;
6672
- "use strict";
6673
- var $;
6674
6753
  (function ($_1) {
6675
6754
  $mol_test_mocks.push($ => {
6676
6755
  $.$mol_after_frame = $mol_after_mock_commmon;
@@ -6762,64 +6841,6 @@ var $;
6762
6841
  ;
6763
6842
  "use strict";
6764
6843
  var $;
6765
- (function ($) {
6766
- function $mol_wire_sync(obj) {
6767
- return new Proxy(obj, {
6768
- get(obj, field) {
6769
- const val = obj[field];
6770
- if (typeof val !== 'function')
6771
- return val;
6772
- const temp = $mol_wire_task.getter(val);
6773
- return function $mol_wire_sync(...args) {
6774
- const fiber = temp(obj, args);
6775
- return fiber.sync();
6776
- };
6777
- }
6778
- });
6779
- }
6780
- $.$mol_wire_sync = $mol_wire_sync;
6781
- })($ || ($ = {}));
6782
- //mol/wire/sync/sync.ts
6783
- ;
6784
- "use strict";
6785
- var $;
6786
- (function ($) {
6787
- function $mol_promise() {
6788
- let done;
6789
- let fail;
6790
- const promise = new Promise((d, f) => {
6791
- done = d;
6792
- fail = f;
6793
- });
6794
- return Object.assign(promise, {
6795
- done,
6796
- fail,
6797
- });
6798
- }
6799
- $.$mol_promise = $mol_promise;
6800
- })($ || ($ = {}));
6801
- //mol/promise/promise.ts
6802
- ;
6803
- "use strict";
6804
- var $;
6805
- (function ($) {
6806
- function $mol_wait_timeout_async(timeout) {
6807
- const promise = $mol_promise();
6808
- const task = new this.$mol_after_timeout(timeout, () => promise.done());
6809
- return Object.assign(promise, {
6810
- destructor: () => task.destructor()
6811
- });
6812
- }
6813
- $.$mol_wait_timeout_async = $mol_wait_timeout_async;
6814
- function $mol_wait_timeout(timeout) {
6815
- return this.$mol_wire_sync(this).$mol_wait_timeout_async(timeout);
6816
- }
6817
- $.$mol_wait_timeout = $mol_wait_timeout;
6818
- })($ || ($ = {}));
6819
- //mol/wait/timeout/timeout.ts
6820
- ;
6821
- "use strict";
6822
- var $;
6823
6844
  (function ($_1) {
6824
6845
  $mol_test({
6825
6846
  'Cached channel'($) {
@@ -8112,7 +8133,6 @@ var $;
8112
8133
  "use strict";
8113
8134
  var $;
8114
8135
  (function ($) {
8115
- const TextDecoder = globalThis.TextDecoder ?? $node.util.TextDecoder;
8116
8136
  function $mol_charset_decode(value, code = 'utf8') {
8117
8137
  return new TextDecoder(code).decode(value);
8118
8138
  }