mol_text_distance 0.0.1267 → 0.0.1268

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
@@ -774,11 +774,11 @@ var $;
774
774
  function $mol_dev_format_button(label, click) {
775
775
  return $mol_dev_format_auto({
776
776
  [$.$mol_dev_format_head]() {
777
- return $mol_dev_format_span({ color: 'cornflowerblue' }, label);
777
+ return $.$mol_dev_format_span({ color: 'cornflowerblue' }, label);
778
778
  },
779
779
  [$.$mol_dev_format_body]() {
780
780
  Promise.resolve().then(click);
781
- return $mol_dev_format_span({});
781
+ return $.$mol_dev_format_span({});
782
782
  }
783
783
  });
784
784
  }
@@ -800,7 +800,7 @@ var $;
800
800
  return $mol_dev_format_native(val);
801
801
  }
802
802
  if (val instanceof Error) {
803
- return $mol_dev_format_span({}, $mol_dev_format_native(val), ' ', $mol_dev_format_button('throw', () => $mol_fail_hidden(val)));
803
+ return $.$mol_dev_format_span({}, $mol_dev_format_native(val), ' ', $mol_dev_format_button('throw', () => $mol_fail_hidden(val)));
804
804
  }
805
805
  if (val instanceof Promise) {
806
806
  return $.$mol_dev_format_shade($mol_dev_format_native(val), ' ', val[Symbol.toStringTag] ?? '');
@@ -872,28 +872,23 @@ var $;
872
872
  ];
873
873
  }
874
874
  $.$mol_dev_format_element = $mol_dev_format_element;
875
- function $mol_dev_format_span(style, ...content) {
876
- return $mol_dev_format_element('span', {
877
- ...style,
878
- }, ...content);
879
- }
880
- $.$mol_dev_format_span = $mol_dev_format_span;
875
+ $.$mol_dev_format_span = $mol_dev_format_element.bind(null, 'span');
881
876
  $.$mol_dev_format_div = $mol_dev_format_element.bind(null, 'div');
882
877
  $.$mol_dev_format_ol = $mol_dev_format_element.bind(null, 'ol');
883
878
  $.$mol_dev_format_li = $mol_dev_format_element.bind(null, 'li');
884
879
  $.$mol_dev_format_table = $mol_dev_format_element.bind(null, 'table');
885
880
  $.$mol_dev_format_tr = $mol_dev_format_element.bind(null, 'tr');
886
881
  $.$mol_dev_format_td = $mol_dev_format_element.bind(null, 'td');
887
- $.$mol_dev_format_accent = $mol_dev_format_span.bind(null, {
882
+ $.$mol_dev_format_accent = $.$mol_dev_format_span.bind(null, {
888
883
  'color': 'magenta',
889
884
  });
890
- $.$mol_dev_format_strong = $mol_dev_format_span.bind(null, {
885
+ $.$mol_dev_format_strong = $.$mol_dev_format_span.bind(null, {
891
886
  'font-weight': 'bold',
892
887
  });
893
- $.$mol_dev_format_string = $mol_dev_format_span.bind(null, {
888
+ $.$mol_dev_format_string = $.$mol_dev_format_span.bind(null, {
894
889
  'color': 'green',
895
890
  });
896
- $.$mol_dev_format_shade = $mol_dev_format_span.bind(null, {
891
+ $.$mol_dev_format_shade = $.$mol_dev_format_span.bind(null, {
897
892
  'color': 'gray',
898
893
  });
899
894
  $.$mol_dev_format_indent = $.$mol_dev_format_div.bind(null, {
@@ -1685,15 +1680,22 @@ var $;
1685
1680
  return function $mol_wire_task_get(host, args) {
1686
1681
  const sub = $mol_wire_auto();
1687
1682
  const existen = sub?.track_next();
1683
+ let cause = '';
1688
1684
  reuse: if (existen) {
1689
1685
  if (!existen.temp)
1690
1686
  break reuse;
1691
- if (existen.host !== host)
1687
+ if (existen.task !== task) {
1688
+ cause = 'task';
1692
1689
  break reuse;
1693
- if (existen.task !== task)
1690
+ }
1691
+ if (existen.host !== host) {
1692
+ cause = 'host';
1694
1693
  break reuse;
1695
- if (!$mol_compare_deep(existen.args, args))
1694
+ }
1695
+ if (!$mol_compare_deep(existen.args, args)) {
1696
+ cause = 'args';
1696
1697
  break reuse;
1698
+ }
1697
1699
  return existen;
1698
1700
  }
1699
1701
  const key = (host?.[Symbol.toStringTag] ?? host) + ('.' + task.name + '<#>');
@@ -1701,11 +1703,11 @@ var $;
1701
1703
  if (existen?.temp) {
1702
1704
  $$.$mol_log3_warn({
1703
1705
  place: '$mol_wire_task',
1704
- message: `Non idempotency`,
1706
+ message: `Different ${cause} on restart`,
1705
1707
  sub,
1706
- pubs: [...sub?.pub_list ?? [], existen],
1708
+ prev: existen,
1707
1709
  next,
1708
- hint: 'Ignore it',
1710
+ hint: 'Maybe required additional memoization',
1709
1711
  });
1710
1712
  }
1711
1713
  return next;