mol_text_distance 0.0.1212 → 0.0.1214

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
@@ -682,7 +682,7 @@ var $;
682
682
  emit(quant = $mol_wire_cursor.stale) {
683
683
  for (let i = this.sub_from; i < this.data.length; i += 2) {
684
684
  ;
685
- this.data[i].absorb(quant);
685
+ this.data[i].absorb(quant, this.data[i + 1]);
686
686
  }
687
687
  }
688
688
  peer_move(from_pos, to_pos) {
@@ -933,13 +933,24 @@ var $;
933
933
  pub?.complete();
934
934
  }
935
935
  }
936
- absorb(quant = $mol_wire_cursor.stale) {
936
+ absorb(quant = $mol_wire_cursor.stale, pos = -1) {
937
937
  if (this.cursor === $mol_wire_cursor.final)
938
938
  return;
939
939
  if (this.cursor >= quant)
940
940
  return;
941
941
  this.cursor = quant;
942
942
  this.emit($mol_wire_cursor.doubt);
943
+ if (pos >= 0 && pos < this.sub_from - 2) {
944
+ const pub = this.data[pos];
945
+ if (pub instanceof $mol_wire_task)
946
+ return;
947
+ for (let cursor = this.pub_from; cursor < this.sub_from; cursor += 2) {
948
+ const pub = this.data[cursor];
949
+ if (pub instanceof $mol_wire_task) {
950
+ pub.destructor();
951
+ }
952
+ }
953
+ }
943
954
  }
944
955
  [$mol_dev_format_head]() {
945
956
  return $mol_dev_format_native(this);