mol_text_distance 0.0.1068 → 0.0.1069

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
@@ -1796,17 +1796,20 @@ var $;
1796
1796
  "use strict";
1797
1797
  var $;
1798
1798
  (function ($) {
1799
- function $mol_promise() {
1800
- let done;
1801
- let fail;
1802
- const promise = new Promise((d, f) => {
1803
- done = d;
1804
- fail = f;
1805
- });
1806
- return Object.assign(promise, {
1807
- done,
1808
- fail,
1809
- });
1799
+ class $mol_promise extends Promise {
1800
+ done;
1801
+ fail;
1802
+ constructor(executor) {
1803
+ let done;
1804
+ let fail;
1805
+ super((d, f) => {
1806
+ done = d;
1807
+ fail = f;
1808
+ executor?.(d, f);
1809
+ });
1810
+ this.done = done;
1811
+ this.fail = fail;
1812
+ }
1810
1813
  }
1811
1814
  $.$mol_promise = $mol_promise;
1812
1815
  })($ || ($ = {}));
@@ -1908,7 +1911,7 @@ var $;
1908
1911
  var $;
1909
1912
  (function ($) {
1910
1913
  function $mol_wait_timeout_async(timeout) {
1911
- const promise = $mol_promise();
1914
+ const promise = new $mol_promise();
1912
1915
  const task = new this.$mol_after_timeout(timeout, () => promise.done());
1913
1916
  return Object.assign(promise, {
1914
1917
  destructor: () => task.destructor()