mol_text_distance 0.0.1000 → 0.0.1001

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.deps.json CHANGED
@@ -1 +1 @@
1
- {"files":["mam.ts","LICENSE","README.md","mam.jam.js","tsfmt.json","package.json","tsconfig.json","lang.lang.tree","meta.lang.tree","sandbox.config.json","mol/CNAME","mol/LICENSE","mol/readme.md","mol/mol.meta.tree","mol/CONTRIBUTING.md","mol/CODE_OF_CONDUCT.md","mol/text/profile/profile.ts","mol/text/profile/distance/distance.ts","mol/text/distance/readme.md","mol/text/distance/distance.ts"],"mods":{},"deps_in":{"mol/text":{"mol/text/distance":-9007199254740991,"mol/text/profile":-9007199254740991},"mol":{"mol/text":-9007199254740991},"":{"mol":-9007199254740991},"mol/text/profile/distance":{"mol/text/distance":-2},"mol/text/profile":{"mol/text/profile/distance":-9007199254740991,"mol/text/distance":-3}},"deps_out":{"mol/text/distance":{"mol/text":-9007199254740991,"mol/text/profile/distance":-2,"mol/text/profile":-3},"mol/text":{"mol":-9007199254740991},"mol":{"":-9007199254740991},"mol/text/profile/distance":{"mol/text/profile":-9007199254740991},"mol/text/profile":{"mol/text":-9007199254740991}},"sloc":{"ts":55,"LICENSE":113,"md":503,"js":9,"json":82,"tree":41,"CNAME":1},"deps":{"mol/text/distance":{"..":-9007199254740991,"/mol/text/distance":-1,"/mol/text/profile/distance":-2,"/mol/text/profile":-3},"mol/text":{"..":-9007199254740991},"mol":{"..":-9007199254740991},"":{},"mol/text/profile/distance":{"..":-9007199254740991,"/mol/text/profile/distance":-1},"mol/text/profile":{"..":-9007199254740991,"/mol/text/profile":-1}}}
1
+ {"files":["mam.ts","LICENSE","README.md","mam.jam.js","tsfmt.json","package.json","tsconfig.json","lang.lang.tree","meta.lang.tree","sandbox.config.json","mol/CNAME","mol/LICENSE","mol/readme.md","mol/mol.meta.tree","mol/CONTRIBUTING.md","mol/CODE_OF_CONDUCT.md","mol/text/profile/profile.ts","mol/text/profile/distance/distance.ts","mol/text/distance/readme.md","mol/text/distance/distance.ts"],"mods":{},"deps_in":{"mol/text":{"mol/text/distance":-9007199254740991,"mol/text/profile":-9007199254740991},"mol":{"mol/text":-9007199254740991},"":{"mol":-9007199254740991},"mol/text/profile/distance":{"mol/text/distance":-2},"mol/text/profile":{"mol/text/profile/distance":-9007199254740991,"mol/text/distance":-3}},"deps_out":{"mol/text/distance":{"mol/text":-9007199254740991,"mol/text/profile/distance":-2,"mol/text/profile":-3},"mol/text":{"mol":-9007199254740991},"mol":{"":-9007199254740991},"mol/text/profile/distance":{"mol/text/profile":-9007199254740991},"mol/text/profile":{"mol/text":-9007199254740991}},"sloc":{"ts":55,"LICENSE":113,"md":503,"js":9,"json":83,"tree":41,"CNAME":1},"deps":{"mol/text/distance":{"..":-9007199254740991,"/mol/text/distance":-1,"/mol/text/profile/distance":-2,"/mol/text/profile":-3},"mol/text":{"..":-9007199254740991},"mol":{"..":-9007199254740991},"":{},"mol/text/profile/distance":{"..":-9007199254740991,"/mol/text/profile/distance":-1},"mol/text/profile":{"..":-9007199254740991,"/mol/text/profile":-1}}}
package/node.test.js CHANGED
@@ -1147,7 +1147,7 @@ var $;
1147
1147
  "use strict";
1148
1148
  var $;
1149
1149
  (function ($) {
1150
- const handled = new WeakSet();
1150
+ const wrappers = new WeakMap();
1151
1151
  class $mol_wire_fiber extends $mol_wire_pub_sub {
1152
1152
  task;
1153
1153
  host;
@@ -1282,13 +1282,21 @@ var $;
1282
1282
  result = this.task.call(this.host, ...this.args);
1283
1283
  break;
1284
1284
  }
1285
- if ($mol_promise_like(result) && !handled.has(result)) {
1286
- const put = (res) => {
1287
- if (this.cache === result)
1288
- this.put(res);
1289
- return res;
1290
- };
1291
- result = result.then(put, put);
1285
+ if ($mol_promise_like(result)) {
1286
+ if (wrappers.has(result)) {
1287
+ result = wrappers.get(result).then(a => a);
1288
+ }
1289
+ else {
1290
+ const put = (res) => {
1291
+ if (this.cache === result)
1292
+ this.put(res);
1293
+ return res;
1294
+ };
1295
+ wrappers.set(result, result = Object.assign(result.then(put, put), { destructor: result.destructor || (() => { }) }));
1296
+ wrappers.set(result, result);
1297
+ const error = new Error(`Promise in ${this}`);
1298
+ Object.defineProperty(result, 'stack', { get: () => error.stack });
1299
+ }
1292
1300
  }
1293
1301
  }
1294
1302
  catch (error) {
@@ -1298,21 +1306,20 @@ var $;
1298
1306
  else {
1299
1307
  result = new Error(String(error), { cause: error });
1300
1308
  }
1301
- if ($mol_promise_like(result) && !handled.has(result)) {
1302
- result = result.finally(() => {
1303
- if (this.cache === result)
1304
- this.absorb();
1305
- });
1309
+ if ($mol_promise_like(result)) {
1310
+ if (wrappers.has(result)) {
1311
+ result = wrappers.get(result);
1312
+ }
1313
+ else {
1314
+ wrappers.set(result, result = Object.assign(result.finally(() => {
1315
+ if (this.cache === result)
1316
+ this.absorb();
1317
+ }), { destructor: result.destructor || (() => { }) }));
1318
+ const error = new Error(`Promise in ${this}`);
1319
+ Object.defineProperty(result, 'stack', { get: () => error.stack });
1320
+ }
1306
1321
  }
1307
1322
  }
1308
- if ($mol_promise_like(result) && !handled.has(result)) {
1309
- result = Object.assign(result, {
1310
- destructor: result['destructor'] ?? (() => { })
1311
- });
1312
- handled.add(result);
1313
- const error = new Error(`Promise in ${this}`);
1314
- Object.defineProperty(result, 'stack', { get: () => error.stack });
1315
- }
1316
1323
  if (!$mol_promise_like(result)) {
1317
1324
  this.track_cut();
1318
1325
  }
@@ -1372,6 +1379,12 @@ var $;
1372
1379
  };
1373
1380
  });
1374
1381
  }
1382
+ destructor() {
1383
+ super.destructor();
1384
+ if ($mol_owning_check(this, this.cache)) {
1385
+ this.cache.destructor();
1386
+ }
1387
+ }
1375
1388
  }
1376
1389
  $.$mol_wire_fiber = $mol_wire_fiber;
1377
1390
  })($ || ($ = {}));
@@ -1484,7 +1497,8 @@ var $;
1484
1497
  $$.$mol_log3_warn({
1485
1498
  place: '$mol_wire_task',
1486
1499
  message: `Non idempotency`,
1487
- existen,
1500
+ sub,
1501
+ pubs: [...sub?.pub_list ?? [], existen],
1488
1502
  next,
1489
1503
  hint: 'Ignore it',
1490
1504
  });
@@ -1507,6 +1521,14 @@ var $;
1507
1521
  this.cursor = $mol_wire_cursor.fresh;
1508
1522
  if (next !== prev)
1509
1523
  this.emit();
1524
+ if ($mol_owning_catch(this, next)) {
1525
+ try {
1526
+ next[Symbol.toStringTag] = this[Symbol.toStringTag];
1527
+ }
1528
+ catch {
1529
+ Object.defineProperty(next, Symbol.toStringTag, { value: this[Symbol.toStringTag] });
1530
+ }
1531
+ }
1510
1532
  return next;
1511
1533
  }
1512
1534
  this.cursor = $mol_wire_cursor.final;
@@ -2070,6 +2092,17 @@ var $;
2070
2092
  ;
2071
2093
  "use strict";
2072
2094
 
2095
+ ;
2096
+ "use strict";
2097
+ var $;
2098
+ (function ($) {
2099
+ function $mol_dom_serialize(node) {
2100
+ const serializer = new $mol_dom_context.XMLSerializer;
2101
+ return serializer.serializeToString(node);
2102
+ }
2103
+ $.$mol_dom_serialize = $mol_dom_serialize;
2104
+ })($ || ($ = {}));
2105
+
2073
2106
  ;
2074
2107
  "use strict";
2075
2108
  var $;
@@ -2227,6 +2260,19 @@ var $;
2227
2260
  "!");
2228
2261
  $mol_assert_equal(dom.outerHTML, '<div>hello<strong>world</strong>!</div>');
2229
2262
  },
2263
+ 'Make fragment'() {
2264
+ const dom = $mol_jsx($mol_jsx_frag, null,
2265
+ $mol_jsx("br", null),
2266
+ $mol_jsx("hr", null));
2267
+ $mol_assert_equal($mol_dom_serialize(dom), '<br xmlns="http://www.w3.org/1999/xhtml" /><hr xmlns="http://www.w3.org/1999/xhtml" />');
2268
+ },
2269
+ 'Spread fragment'() {
2270
+ const dom = $mol_jsx("div", null,
2271
+ $mol_jsx($mol_jsx_frag, null,
2272
+ $mol_jsx("br", null),
2273
+ $mol_jsx("hr", null)));
2274
+ $mol_assert_equal(dom.outerHTML, '<div><br><hr></div>');
2275
+ },
2230
2276
  'Function as component'() {
2231
2277
  const Button = (props, target) => {
2232
2278
  return $mol_jsx("button", { title: props.hint }, target());