mol_text_distance 0.0.999 → 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 +1 -1
- package/node.test.js +68 -24
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.deps.json +1 -1
- package/web.test.js +24 -0
- package/web.test.js.map +1 -1
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":
|
|
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
|
|
1150
|
+
const wrappers = new WeakMap();
|
|
1151
1151
|
class $mol_wire_fiber extends $mol_wire_pub_sub {
|
|
1152
1152
|
task;
|
|
1153
1153
|
host;
|
|
@@ -1282,14 +1282,21 @@ var $;
|
|
|
1282
1282
|
result = this.task.call(this.host, ...this.args);
|
|
1283
1283
|
break;
|
|
1284
1284
|
}
|
|
1285
|
-
if ($mol_promise_like(result)
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
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
|
+
}
|
|
1293
1300
|
}
|
|
1294
1301
|
}
|
|
1295
1302
|
catch (error) {
|
|
@@ -1299,22 +1306,20 @@ var $;
|
|
|
1299
1306
|
else {
|
|
1300
1307
|
result = new Error(String(error), { cause: error });
|
|
1301
1308
|
}
|
|
1302
|
-
if ($mol_promise_like(result)
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
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
|
+
}
|
|
1308
1321
|
}
|
|
1309
1322
|
}
|
|
1310
|
-
if ($mol_promise_like(result) && !handled.has(result)) {
|
|
1311
|
-
result = Object.assign(result, {
|
|
1312
|
-
destructor: result['destructor'] ?? (() => { })
|
|
1313
|
-
});
|
|
1314
|
-
handled.add(result);
|
|
1315
|
-
const error = new Error(`Promise in ${this}`);
|
|
1316
|
-
Object.defineProperty(result, 'stack', { get: () => error.stack });
|
|
1317
|
-
}
|
|
1318
1323
|
if (!$mol_promise_like(result)) {
|
|
1319
1324
|
this.track_cut();
|
|
1320
1325
|
}
|
|
@@ -1374,6 +1379,12 @@ var $;
|
|
|
1374
1379
|
};
|
|
1375
1380
|
});
|
|
1376
1381
|
}
|
|
1382
|
+
destructor() {
|
|
1383
|
+
super.destructor();
|
|
1384
|
+
if ($mol_owning_check(this, this.cache)) {
|
|
1385
|
+
this.cache.destructor();
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1377
1388
|
}
|
|
1378
1389
|
$.$mol_wire_fiber = $mol_wire_fiber;
|
|
1379
1390
|
})($ || ($ = {}));
|
|
@@ -1486,7 +1497,8 @@ var $;
|
|
|
1486
1497
|
$$.$mol_log3_warn({
|
|
1487
1498
|
place: '$mol_wire_task',
|
|
1488
1499
|
message: `Non idempotency`,
|
|
1489
|
-
|
|
1500
|
+
sub,
|
|
1501
|
+
pubs: [...sub?.pub_list ?? [], existen],
|
|
1490
1502
|
next,
|
|
1491
1503
|
hint: 'Ignore it',
|
|
1492
1504
|
});
|
|
@@ -1509,6 +1521,14 @@ var $;
|
|
|
1509
1521
|
this.cursor = $mol_wire_cursor.fresh;
|
|
1510
1522
|
if (next !== prev)
|
|
1511
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
|
+
}
|
|
1512
1532
|
return next;
|
|
1513
1533
|
}
|
|
1514
1534
|
this.cursor = $mol_wire_cursor.final;
|
|
@@ -2072,6 +2092,17 @@ var $;
|
|
|
2072
2092
|
;
|
|
2073
2093
|
"use strict";
|
|
2074
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
|
+
|
|
2075
2106
|
;
|
|
2076
2107
|
"use strict";
|
|
2077
2108
|
var $;
|
|
@@ -2229,6 +2260,19 @@ var $;
|
|
|
2229
2260
|
"!");
|
|
2230
2261
|
$mol_assert_equal(dom.outerHTML, '<div>hello<strong>world</strong>!</div>');
|
|
2231
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
|
+
},
|
|
2232
2276
|
'Function as component'() {
|
|
2233
2277
|
const Button = (props, target) => {
|
|
2234
2278
|
return $mol_jsx("button", { title: props.hint }, target());
|