mol_plot_all 1.2.560 → 1.2.562

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
@@ -591,6 +591,16 @@ var $;
591
591
  ;
592
592
  "use strict";
593
593
  var $;
594
+ (function ($) {
595
+ function $mol_promise_like(val) {
596
+ return val && typeof val.then === 'function';
597
+ }
598
+ $.$mol_promise_like = $mol_promise_like;
599
+ })($ || ($ = {}));
600
+ //mol/promise/like/like.ts
601
+ ;
602
+ "use strict";
603
+ var $;
594
604
  (function ($) {
595
605
  const handled = new WeakSet();
596
606
  class $mol_wire_fiber extends $mol_wire_pub_sub {
@@ -639,7 +649,7 @@ var $;
639
649
  return this.data.slice(0, this.pub_from);
640
650
  }
641
651
  result() {
642
- if (this.cache instanceof Promise)
652
+ if ($mol_promise_like(this.cache))
643
653
  return;
644
654
  if (this.cache instanceof Error)
645
655
  return;
@@ -718,7 +728,7 @@ var $;
718
728
  result = this.task.call(this.host, ...this.args);
719
729
  break;
720
730
  }
721
- if (result instanceof Promise) {
731
+ if ($mol_promise_like(result)) {
722
732
  const put = (res) => {
723
733
  if (this.cache === result)
724
734
  this.put(res);
@@ -731,13 +741,13 @@ var $;
731
741
  }
732
742
  }
733
743
  catch (error) {
734
- if (error instanceof Error || error instanceof Promise) {
744
+ if (error instanceof Error || $mol_promise_like(error)) {
735
745
  result = error;
736
746
  }
737
747
  else {
738
748
  result = new Error(String(error), { cause: error });
739
749
  }
740
- if (result instanceof Promise && !handled.has(result)) {
750
+ if ($mol_promise_like(result) && !handled.has(result)) {
741
751
  result = Object.assign(result.finally(() => {
742
752
  if (this.cache === result)
743
753
  this.absorb();
@@ -747,7 +757,7 @@ var $;
747
757
  handled.add(result);
748
758
  }
749
759
  }
750
- if (!(result instanceof Promise)) {
760
+ if (!$mol_promise_like(result)) {
751
761
  this.track_cut();
752
762
  }
753
763
  this.track_off(bu);
@@ -766,7 +776,7 @@ var $;
766
776
  if (this.cache instanceof Error) {
767
777
  return $mol_fail_hidden(this.cache);
768
778
  }
769
- if (this.cache instanceof Promise) {
779
+ if ($mol_promise_like(this.cache)) {
770
780
  return $mol_fail_hidden(this.cache);
771
781
  }
772
782
  return this.cache;
@@ -777,7 +787,7 @@ var $;
777
787
  if (this.cache instanceof Error) {
778
788
  $mol_fail_hidden(this.cache);
779
789
  }
780
- if (!(this.cache instanceof Promise))
790
+ if (!$mol_promise_like(this.cache))
781
791
  return this.cache;
782
792
  await this.cache;
783
793
  if (this.cursor === $mol_wire_cursor.final) {
@@ -1032,14 +1042,14 @@ var $;
1032
1042
  };
1033
1043
  }
1034
1044
  complete() {
1035
- if (this.cache instanceof Promise)
1045
+ if ($mol_promise_like(this.cache))
1036
1046
  return;
1037
1047
  this.destructor();
1038
1048
  }
1039
1049
  put(next) {
1040
1050
  const prev = this.cache;
1041
1051
  this.cache = next;
1042
- if (next instanceof Promise) {
1052
+ if ($mol_promise_like(next)) {
1043
1053
  this.cursor = $mol_wire_cursor.fresh;
1044
1054
  if (next !== prev)
1045
1055
  this.emit();
@@ -1096,7 +1106,7 @@ var $;
1096
1106
  function $mol_fail_catch(error) {
1097
1107
  if (typeof error !== 'object')
1098
1108
  return false;
1099
- if (error instanceof Promise)
1109
+ if ($mol_promise_like(error))
1100
1110
  $mol_fail_hidden(error);
1101
1111
  if (catched.get(error))
1102
1112
  return false;
@@ -1111,7 +1121,7 @@ var $;
1111
1121
  var $;
1112
1122
  (function ($) {
1113
1123
  function $mol_fail_log(error) {
1114
- if (error instanceof Promise)
1124
+ if ($mol_promise_like(error))
1115
1125
  return false;
1116
1126
  if (!$mol_fail_catch(error))
1117
1127
  return false;
@@ -1235,7 +1245,7 @@ var $;
1235
1245
  }
1236
1246
  this.cache = next;
1237
1247
  this.cursor = $mol_wire_cursor.fresh;
1238
- if (next instanceof Promise)
1248
+ if ($mol_promise_like(next))
1239
1249
  return next;
1240
1250
  this.complete_pubs();
1241
1251
  return next;
@@ -2204,11 +2214,12 @@ var $;
2204
2214
  for (let name in styles) {
2205
2215
  let val = styles[name];
2206
2216
  const style = el.style;
2217
+ const kebab = (name) => name.replace(/[A-Z]/g, letter => '-' + letter.toLowerCase());
2207
2218
  if (typeof val === 'number') {
2208
- style[name] = `${val}px`;
2219
+ style.setProperty(kebab(name), `${val}px`);
2209
2220
  }
2210
2221
  else {
2211
- style[name] = val;
2222
+ style.setProperty(kebab(name), val);
2212
2223
  }
2213
2224
  }
2214
2225
  }
@@ -2629,7 +2640,7 @@ var $;
2629
2640
  catch (error) {
2630
2641
  $mol_fail_log(error);
2631
2642
  $mol_dom_render_attributes(node, { mol_view_error: error.name || error.constructor.name });
2632
- if (error instanceof Promise)
2643
+ if ($mol_promise_like(error))
2633
2644
  break render;
2634
2645
  if ((error_showed.get(error) ?? this) !== this)
2635
2646
  break render;
@@ -2779,7 +2790,7 @@ var $;
2779
2790
  }
2780
2791
  }
2781
2792
  catch (error) {
2782
- if (error instanceof Promise)
2793
+ if ($mol_promise_like(error))
2783
2794
  $mol_fail_hidden(error);
2784
2795
  $mol_fail_log(error);
2785
2796
  }
@@ -6175,7 +6186,7 @@ var $;
6175
6186
  for (let mock of $_1.$mol_test_mocks)
6176
6187
  await mock(context);
6177
6188
  const res = test(context);
6178
- if (res instanceof Promise) {
6189
+ if ($mol_promise_like(res)) {
6179
6190
  await new Promise((done, fail) => {
6180
6191
  res.then(done, fail);
6181
6192
  setTimeout(() => fail(new Error('Test timeout: ' + test.name)), 1000);
@@ -7020,7 +7031,7 @@ var $;
7020
7031
  return $mol_wire_sync(Handle).sum(1, 2);
7021
7032
  }
7022
7033
  catch (error) {
7023
- if (error instanceof Promise)
7034
+ if ($mol_promise_like(error))
7024
7035
  $mol_fail_hidden(error);
7025
7036
  $mol_assert_equal(error.message, 'test error 3');
7026
7037
  }
@@ -7052,7 +7063,7 @@ var $;
7052
7063
  }
7053
7064
  $.$mol_promise = $mol_promise;
7054
7065
  })($ || ($ = {}));
7055
- //mol/promise/promise.ts
7066
+ //mol/promise/promise/promise.ts
7056
7067
  ;
7057
7068
  "use strict";
7058
7069
  var $;