mol_plot_all 1.2.244 → 1.2.247
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.d.ts +48 -10
- package/node.deps.json +1 -1
- package/node.esm.js +129 -54
- package/node.esm.js.map +1 -1
- package/node.js +129 -54
- package/node.js.map +1 -1
- package/node.test.js +254 -166
- package/node.test.js.map +1 -1
- package/node.view.tree +1 -1
- package/package.json +4 -2
- package/web.d.ts +19 -10
- package/web.deps.json +1 -1
- package/web.esm.js +79 -63
- package/web.esm.js.map +1 -1
- package/web.js +79 -63
- package/web.js.map +1 -1
- package/web.test.js +115 -102
- package/web.test.js.map +1 -1
- package/web.view.tree +1 -1
package/node.test.js
CHANGED
|
@@ -232,6 +232,8 @@ var $node = new Proxy({ require }, {
|
|
|
232
232
|
const mod = target.require('module');
|
|
233
233
|
if (mod.builtinModules.indexOf(name) >= 0)
|
|
234
234
|
return target.require(name);
|
|
235
|
+
if (name[0] === '.')
|
|
236
|
+
return target.require(name);
|
|
235
237
|
const path = target.require('path');
|
|
236
238
|
const fs = target.require('fs');
|
|
237
239
|
let dir = path.resolve('.');
|
|
@@ -619,29 +621,72 @@ var $;
|
|
|
619
621
|
;
|
|
620
622
|
"use strict";
|
|
621
623
|
var $;
|
|
624
|
+
(function ($) {
|
|
625
|
+
class $mol_term_color {
|
|
626
|
+
static reset = this.ansi(0, 0);
|
|
627
|
+
static bold = this.ansi(1, 22);
|
|
628
|
+
static italic = this.ansi(3, 23);
|
|
629
|
+
static underline = this.ansi(4, 24);
|
|
630
|
+
static inverse = this.ansi(7, 27);
|
|
631
|
+
static hidden = this.ansi(8, 28);
|
|
632
|
+
static strike = this.ansi(9, 29);
|
|
633
|
+
static gray = this.ansi(90, 39);
|
|
634
|
+
static red = this.ansi(91, 39);
|
|
635
|
+
static green = this.ansi(92, 39);
|
|
636
|
+
static yellow = this.ansi(93, 39);
|
|
637
|
+
static blue = this.ansi(94, 39);
|
|
638
|
+
static magenta = this.ansi(95, 39);
|
|
639
|
+
static cyan = this.ansi(96, 39);
|
|
640
|
+
static white = this.ansi(97, 39);
|
|
641
|
+
static Red = (str) => this.inverse(this.red(str));
|
|
642
|
+
static Green = (str) => this.inverse(this.green(str));
|
|
643
|
+
static Yellow = (str) => this.inverse(this.yellow(str));
|
|
644
|
+
static Blue = (str) => this.inverse(this.blue(str));
|
|
645
|
+
static Magenta = (str) => this.inverse(this.magenta(str));
|
|
646
|
+
static Cyan = (str) => this.inverse(this.cyan(str));
|
|
647
|
+
static White = (str) => this.inverse(this.white(str));
|
|
648
|
+
static ansi(open, close) {
|
|
649
|
+
if (typeof process === 'undefined')
|
|
650
|
+
return String;
|
|
651
|
+
if (!process.stdout.isTTY)
|
|
652
|
+
return String;
|
|
653
|
+
const prefix = `\x1b[${open}m`;
|
|
654
|
+
const postfix = `\x1b[${close}m`;
|
|
655
|
+
const suffix_regexp = new RegExp(postfix.replace('[', '\\['), 'g');
|
|
656
|
+
return function colorer(str) {
|
|
657
|
+
str = String(str);
|
|
658
|
+
if (str === '')
|
|
659
|
+
return str;
|
|
660
|
+
const suffix = str.replace(suffix_regexp, prefix);
|
|
661
|
+
return prefix + suffix + postfix;
|
|
662
|
+
};
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
$.$mol_term_color = $mol_term_color;
|
|
666
|
+
})($ || ($ = {}));
|
|
667
|
+
//mol/term/color/color.ts
|
|
668
|
+
;
|
|
669
|
+
"use strict";
|
|
670
|
+
var $;
|
|
622
671
|
(function ($) {
|
|
623
672
|
function $mol_log3_node_make(level, output, type, color) {
|
|
624
673
|
return function $mol_log3_logger(event) {
|
|
625
674
|
if (!event.time)
|
|
626
675
|
event = { time: new Date().toISOString(), ...event };
|
|
627
676
|
const tree = this.$mol_tree.fromJSON(event).clone({ type });
|
|
628
|
-
let str = tree.toString();
|
|
629
|
-
if (process[output].isTTY) {
|
|
630
|
-
str = $node.colorette[color + 'Bright'](str);
|
|
631
|
-
}
|
|
632
|
-
;
|
|
677
|
+
let str = color(tree.toString());
|
|
633
678
|
this.console[level](str);
|
|
634
679
|
const self = this;
|
|
635
680
|
return () => self.console.groupEnd();
|
|
636
681
|
};
|
|
637
682
|
}
|
|
638
683
|
$.$mol_log3_node_make = $mol_log3_node_make;
|
|
639
|
-
$.$mol_log3_come = $mol_log3_node_make('info', 'stdout', 'come',
|
|
640
|
-
$.$mol_log3_done = $mol_log3_node_make('info', 'stdout', 'done',
|
|
641
|
-
$.$mol_log3_fail = $mol_log3_node_make('error', 'stderr', 'fail',
|
|
642
|
-
$.$mol_log3_warn = $mol_log3_node_make('warn', 'stderr', 'warn',
|
|
643
|
-
$.$mol_log3_rise = $mol_log3_node_make('log', 'stdout', 'rise',
|
|
644
|
-
$.$mol_log3_area = $mol_log3_node_make('log', 'stdout', 'area',
|
|
684
|
+
$.$mol_log3_come = $mol_log3_node_make('info', 'stdout', 'come', $mol_term_color.blue);
|
|
685
|
+
$.$mol_log3_done = $mol_log3_node_make('info', 'stdout', 'done', $mol_term_color.green);
|
|
686
|
+
$.$mol_log3_fail = $mol_log3_node_make('error', 'stderr', 'fail', $mol_term_color.red);
|
|
687
|
+
$.$mol_log3_warn = $mol_log3_node_make('warn', 'stderr', 'warn', $mol_term_color.yellow);
|
|
688
|
+
$.$mol_log3_rise = $mol_log3_node_make('log', 'stdout', 'rise', $mol_term_color.magenta);
|
|
689
|
+
$.$mol_log3_area = $mol_log3_node_make('log', 'stdout', 'area', $mol_term_color.cyan);
|
|
645
690
|
})($ || ($ = {}));
|
|
646
691
|
//mol/log3/log3.node.ts
|
|
647
692
|
;
|
|
@@ -945,7 +990,7 @@ var $;
|
|
|
945
990
|
promote() {
|
|
946
991
|
$mol_wire_auto()?.track_next(this);
|
|
947
992
|
}
|
|
948
|
-
|
|
993
|
+
fresh() { }
|
|
949
994
|
complete() { }
|
|
950
995
|
emit(quant = $mol_wire_cursor.stale) {
|
|
951
996
|
for (let i = this.sub_from; i < this.data.length; i += 2) {
|
|
@@ -1148,7 +1193,7 @@ var $;
|
|
|
1148
1193
|
}
|
|
1149
1194
|
for (let cursor = this.pub_from; cursor < this.cursor; cursor += 2) {
|
|
1150
1195
|
const pub = this.data[cursor];
|
|
1151
|
-
pub.
|
|
1196
|
+
pub.fresh();
|
|
1152
1197
|
}
|
|
1153
1198
|
this.cursor = $mol_wire_cursor.fresh;
|
|
1154
1199
|
}
|
|
@@ -1284,7 +1329,7 @@ var $;
|
|
|
1284
1329
|
continue;
|
|
1285
1330
|
if (fiber.cursor === $mol_wire_cursor.final)
|
|
1286
1331
|
continue;
|
|
1287
|
-
fiber.
|
|
1332
|
+
fiber.fresh();
|
|
1288
1333
|
}
|
|
1289
1334
|
}
|
|
1290
1335
|
while (this.reaping.size) {
|
|
@@ -1352,7 +1397,7 @@ var $;
|
|
|
1352
1397
|
else
|
|
1353
1398
|
super.emit(quant);
|
|
1354
1399
|
}
|
|
1355
|
-
|
|
1400
|
+
fresh() {
|
|
1356
1401
|
if (this.cursor === $mol_wire_cursor.fresh)
|
|
1357
1402
|
return;
|
|
1358
1403
|
if (this.cursor === $mol_wire_cursor.final)
|
|
@@ -1360,7 +1405,7 @@ var $;
|
|
|
1360
1405
|
check: if (this.cursor === $mol_wire_cursor.doubt) {
|
|
1361
1406
|
for (let i = this.pub_from; i < this.sub_from; i += 2) {
|
|
1362
1407
|
;
|
|
1363
|
-
this.data[i]?.
|
|
1408
|
+
this.data[i]?.fresh();
|
|
1364
1409
|
if (this.cursor !== $mol_wire_cursor.doubt)
|
|
1365
1410
|
break check;
|
|
1366
1411
|
}
|
|
@@ -1416,12 +1461,16 @@ var $;
|
|
|
1416
1461
|
this.track_off(bu);
|
|
1417
1462
|
this.put(result);
|
|
1418
1463
|
}
|
|
1464
|
+
refresh() {
|
|
1465
|
+
this.cursor = $mol_wire_cursor.stale;
|
|
1466
|
+
this.fresh();
|
|
1467
|
+
}
|
|
1419
1468
|
sync() {
|
|
1420
1469
|
if (!$mol_wire_fiber.warm) {
|
|
1421
1470
|
return this.result();
|
|
1422
1471
|
}
|
|
1423
1472
|
this.promote();
|
|
1424
|
-
this.
|
|
1473
|
+
this.fresh();
|
|
1425
1474
|
if (this.cache instanceof Error) {
|
|
1426
1475
|
return $mol_fail_hidden(this.cache);
|
|
1427
1476
|
}
|
|
@@ -1432,7 +1481,7 @@ var $;
|
|
|
1432
1481
|
}
|
|
1433
1482
|
async async() {
|
|
1434
1483
|
while (true) {
|
|
1435
|
-
this.
|
|
1484
|
+
this.fresh();
|
|
1436
1485
|
if (this.cache instanceof Error) {
|
|
1437
1486
|
$mol_fail_hidden(this.cache);
|
|
1438
1487
|
}
|
|
@@ -1734,6 +1783,22 @@ var $;
|
|
|
1734
1783
|
};
|
|
1735
1784
|
}
|
|
1736
1785
|
}
|
|
1786
|
+
static watching = new Set();
|
|
1787
|
+
static watch() {
|
|
1788
|
+
new $mol_after_frame($mol_wire_atom.watch);
|
|
1789
|
+
for (const atom of $mol_wire_atom.watching) {
|
|
1790
|
+
if (atom.cursor === $mol_wire_cursor.final) {
|
|
1791
|
+
$mol_wire_atom.watching.delete(atom);
|
|
1792
|
+
}
|
|
1793
|
+
else {
|
|
1794
|
+
atom.cursor = $mol_wire_cursor.stale;
|
|
1795
|
+
atom.fresh();
|
|
1796
|
+
}
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
watch() {
|
|
1800
|
+
$mol_wire_atom.watching.add(this);
|
|
1801
|
+
}
|
|
1737
1802
|
resync(args) {
|
|
1738
1803
|
return this.put(this.task.call(this.host, ...args));
|
|
1739
1804
|
}
|
|
@@ -1788,6 +1853,7 @@ var $;
|
|
|
1788
1853
|
$mol_wire_method
|
|
1789
1854
|
], $mol_wire_atom.prototype, "once", null);
|
|
1790
1855
|
$.$mol_wire_atom = $mol_wire_atom;
|
|
1856
|
+
$mol_wire_atom.watch();
|
|
1791
1857
|
})($ || ($ = {}));
|
|
1792
1858
|
//mol/wire/atom/atom.ts
|
|
1793
1859
|
;
|
|
@@ -1977,6 +2043,22 @@ var $;
|
|
|
1977
2043
|
;
|
|
1978
2044
|
"use strict";
|
|
1979
2045
|
var $;
|
|
2046
|
+
(function ($) {
|
|
2047
|
+
function $mol_wire_watch() {
|
|
2048
|
+
const atom = $mol_wire_auto();
|
|
2049
|
+
if (atom instanceof $mol_wire_atom) {
|
|
2050
|
+
atom.watch();
|
|
2051
|
+
}
|
|
2052
|
+
else {
|
|
2053
|
+
$mol_fail(new Error('Atom is equired for watching'));
|
|
2054
|
+
}
|
|
2055
|
+
}
|
|
2056
|
+
$.$mol_wire_watch = $mol_wire_watch;
|
|
2057
|
+
})($ || ($ = {}));
|
|
2058
|
+
//mol/wire/watch/watch.ts
|
|
2059
|
+
;
|
|
2060
|
+
"use strict";
|
|
2061
|
+
var $;
|
|
1980
2062
|
(function ($) {
|
|
1981
2063
|
function $mol_const(value) {
|
|
1982
2064
|
var getter = (() => value);
|
|
@@ -2027,7 +2109,12 @@ var $;
|
|
|
2027
2109
|
fiber = temp(obj, args);
|
|
2028
2110
|
return fiber.async();
|
|
2029
2111
|
};
|
|
2030
|
-
}
|
|
2112
|
+
},
|
|
2113
|
+
apply(obj, self, args) {
|
|
2114
|
+
const temp = $mol_wire_task.getter(obj);
|
|
2115
|
+
const fiber = temp(self, args);
|
|
2116
|
+
return fiber.async();
|
|
2117
|
+
},
|
|
2031
2118
|
});
|
|
2032
2119
|
}
|
|
2033
2120
|
$.$mol_wire_async = $mol_wire_async;
|
|
@@ -2266,15 +2353,9 @@ var $;
|
|
|
2266
2353
|
}
|
|
2267
2354
|
static watchers = new Set();
|
|
2268
2355
|
view_rect() {
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
view_rect_cache(next = null) {
|
|
2273
|
-
return next;
|
|
2274
|
-
}
|
|
2275
|
-
view_rect_watcher() {
|
|
2276
|
-
$mol_view.watchers.add(this);
|
|
2277
|
-
return { destructor: () => $mol_view.watchers.delete(this) };
|
|
2356
|
+
$mol_wire_watch();
|
|
2357
|
+
const { width, height, left, right, top, bottom } = this.dom_node().getBoundingClientRect();
|
|
2358
|
+
return { width, height, left, right, top, bottom };
|
|
2278
2359
|
}
|
|
2279
2360
|
dom_id() {
|
|
2280
2361
|
return this.toString();
|
|
@@ -2446,11 +2527,18 @@ var $;
|
|
|
2446
2527
|
*view_find(check, path = []) {
|
|
2447
2528
|
if (check(this))
|
|
2448
2529
|
return yield [...path, this];
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2530
|
+
try {
|
|
2531
|
+
for (const item of this.sub()) {
|
|
2532
|
+
if (item instanceof $mol_view) {
|
|
2533
|
+
yield* item.view_find(check, [...path, this]);
|
|
2534
|
+
}
|
|
2452
2535
|
}
|
|
2453
2536
|
}
|
|
2537
|
+
catch (error) {
|
|
2538
|
+
if (error instanceof Promise)
|
|
2539
|
+
$mol_fail_hidden(error);
|
|
2540
|
+
$mol_fail_log(error);
|
|
2541
|
+
}
|
|
2454
2542
|
}
|
|
2455
2543
|
force_render(path) {
|
|
2456
2544
|
const kids = this.sub();
|
|
@@ -2491,12 +2579,6 @@ var $;
|
|
|
2491
2579
|
__decorate([
|
|
2492
2580
|
$mol_mem
|
|
2493
2581
|
], $mol_view.prototype, "view_rect", null);
|
|
2494
|
-
__decorate([
|
|
2495
|
-
$mol_mem
|
|
2496
|
-
], $mol_view.prototype, "view_rect_cache", null);
|
|
2497
|
-
__decorate([
|
|
2498
|
-
$mol_mem
|
|
2499
|
-
], $mol_view.prototype, "view_rect_watcher", null);
|
|
2500
2582
|
__decorate([
|
|
2501
2583
|
$mol_mem
|
|
2502
2584
|
], $mol_view.prototype, "dom_node", null);
|
|
@@ -3720,7 +3802,7 @@ var $;
|
|
|
3720
3802
|
return this.graphs_sorted();
|
|
3721
3803
|
}
|
|
3722
3804
|
graphs_colored() {
|
|
3723
|
-
return this.
|
|
3805
|
+
return this.graphs_visible();
|
|
3724
3806
|
}
|
|
3725
3807
|
plugins() {
|
|
3726
3808
|
return [
|
|
@@ -3774,11 +3856,11 @@ var $;
|
|
|
3774
3856
|
graphs() {
|
|
3775
3857
|
return [];
|
|
3776
3858
|
}
|
|
3777
|
-
|
|
3859
|
+
graphs_positioned() {
|
|
3778
3860
|
return this.graphs();
|
|
3779
3861
|
}
|
|
3780
|
-
|
|
3781
|
-
return this.
|
|
3862
|
+
graphs_visible() {
|
|
3863
|
+
return this.graphs_positioned();
|
|
3782
3864
|
}
|
|
3783
3865
|
zoom(val) {
|
|
3784
3866
|
if (val !== undefined)
|
|
@@ -3978,7 +4060,7 @@ var $;
|
|
|
3978
4060
|
return (360 + (this.hue_base() + this.hue_shift() * index) % 360) % 360;
|
|
3979
4061
|
}
|
|
3980
4062
|
graphs_colored() {
|
|
3981
|
-
const graphs = this.
|
|
4063
|
+
const graphs = this.graphs_visible();
|
|
3982
4064
|
for (let index = 0; index < graphs.length; index++) {
|
|
3983
4065
|
graphs[index].hue = () => this.graph_hue(index);
|
|
3984
4066
|
}
|
|
@@ -4061,13 +4143,15 @@ var $;
|
|
|
4061
4143
|
const size_real = this.size_real();
|
|
4062
4144
|
const max_x = (viewport.x.max - viewport.x.min) / size_real.x;
|
|
4063
4145
|
const max_y = (viewport.y.max - viewport.y.min) / size_real.y;
|
|
4064
|
-
return this.
|
|
4146
|
+
return this.graphs_positioned().filter(graph => {
|
|
4065
4147
|
const dims = graph.dimensions();
|
|
4066
4148
|
if (dims.x.min > dims.x.max)
|
|
4067
4149
|
return true;
|
|
4068
4150
|
if (dims.y.min > dims.y.max)
|
|
4069
4151
|
return true;
|
|
4070
|
-
|
|
4152
|
+
const size_x = dims.x.max - dims.x.min;
|
|
4153
|
+
const size_y = dims.y.max - dims.y.min;
|
|
4154
|
+
if ((size_x || size_y) && size_x < max_x && size_y < max_y)
|
|
4071
4155
|
return false;
|
|
4072
4156
|
if (dims.x.min > viewport.x.max)
|
|
4073
4157
|
return false;
|
|
@@ -4081,7 +4165,7 @@ var $;
|
|
|
4081
4165
|
});
|
|
4082
4166
|
}
|
|
4083
4167
|
graphs_positioned() {
|
|
4084
|
-
const graphs = this.
|
|
4168
|
+
const graphs = this.graphs();
|
|
4085
4169
|
for (let graph of graphs) {
|
|
4086
4170
|
graph.shift = () => this.shift();
|
|
4087
4171
|
graph.scale = () => this.scale();
|
|
@@ -4529,12 +4613,6 @@ var $;
|
|
|
4529
4613
|
const size_x = Math.max(0, Math.ceil((1 / aspect - 1) * diameter));
|
|
4530
4614
|
return points.map(point => `M ${point[0] - shift_x} ${point[1] - shift_y} l ${size_x} ${size_y}`).join(' ');
|
|
4531
4615
|
}
|
|
4532
|
-
dimensions() {
|
|
4533
|
-
const scale = this.scale();
|
|
4534
|
-
const radius = this.diameter() / Math.min(...scale) / 2;
|
|
4535
|
-
const dims = super.dimensions();
|
|
4536
|
-
return new this.$.$mol_vector_2d(new $mol_vector_range(dims.x.min - radius, dims.x.max + radius), new $mol_vector_range(dims.y.min - radius, dims.y.max + radius));
|
|
4537
|
-
}
|
|
4538
4616
|
}
|
|
4539
4617
|
__decorate([
|
|
4540
4618
|
$mol_mem
|
|
@@ -4542,9 +4620,6 @@ var $;
|
|
|
4542
4620
|
__decorate([
|
|
4543
4621
|
$mol_mem
|
|
4544
4622
|
], $mol_plot_dot.prototype, "indexes", null);
|
|
4545
|
-
__decorate([
|
|
4546
|
-
$mol_mem
|
|
4547
|
-
], $mol_plot_dot.prototype, "dimensions", null);
|
|
4548
4623
|
$$.$mol_plot_dot = $mol_plot_dot;
|
|
4549
4624
|
})($$ = $.$$ || ($.$$ = {}));
|
|
4550
4625
|
})($ || ($ = {}));
|
|
@@ -5931,6 +6006,20 @@ var $;
|
|
|
5931
6006
|
//mol/test/test.test.ts
|
|
5932
6007
|
;
|
|
5933
6008
|
"use strict";
|
|
6009
|
+
var $;
|
|
6010
|
+
(function ($_1) {
|
|
6011
|
+
$mol_test_mocks.push($ => {
|
|
6012
|
+
$.$mol_log3_come = () => { };
|
|
6013
|
+
$.$mol_log3_done = () => { };
|
|
6014
|
+
$.$mol_log3_fail = () => { };
|
|
6015
|
+
$.$mol_log3_warn = () => { };
|
|
6016
|
+
$.$mol_log3_rise = () => { };
|
|
6017
|
+
$.$mol_log3_area = () => () => { };
|
|
6018
|
+
});
|
|
6019
|
+
})($ || ($ = {}));
|
|
6020
|
+
//mol/log3/log3.test.ts
|
|
6021
|
+
;
|
|
6022
|
+
"use strict";
|
|
5934
6023
|
//mol/type/error/error.ts
|
|
5935
6024
|
;
|
|
5936
6025
|
"use strict";
|
|
@@ -6437,20 +6526,6 @@ var $;
|
|
|
6437
6526
|
;
|
|
6438
6527
|
"use strict";
|
|
6439
6528
|
var $;
|
|
6440
|
-
(function ($_1) {
|
|
6441
|
-
$mol_test_mocks.push($ => {
|
|
6442
|
-
$.$mol_log3_come = () => { };
|
|
6443
|
-
$.$mol_log3_done = () => { };
|
|
6444
|
-
$.$mol_log3_fail = () => { };
|
|
6445
|
-
$.$mol_log3_warn = () => { };
|
|
6446
|
-
$.$mol_log3_rise = () => { };
|
|
6447
|
-
$.$mol_log3_area = () => () => { };
|
|
6448
|
-
});
|
|
6449
|
-
})($ || ($ = {}));
|
|
6450
|
-
//mol/log3/log3.test.ts
|
|
6451
|
-
;
|
|
6452
|
-
"use strict";
|
|
6453
|
-
var $;
|
|
6454
6529
|
(function ($_1) {
|
|
6455
6530
|
$mol_test({
|
|
6456
6531
|
'tree parsing'() {
|
|
@@ -6520,6 +6595,78 @@ var $;
|
|
|
6520
6595
|
;
|
|
6521
6596
|
"use strict";
|
|
6522
6597
|
var $;
|
|
6598
|
+
(function ($) {
|
|
6599
|
+
function $mol_promise() {
|
|
6600
|
+
let done;
|
|
6601
|
+
let fail;
|
|
6602
|
+
const promise = new Promise((d, f) => {
|
|
6603
|
+
done = d;
|
|
6604
|
+
fail = f;
|
|
6605
|
+
});
|
|
6606
|
+
return Object.assign(promise, {
|
|
6607
|
+
done,
|
|
6608
|
+
fail,
|
|
6609
|
+
});
|
|
6610
|
+
}
|
|
6611
|
+
$.$mol_promise = $mol_promise;
|
|
6612
|
+
})($ || ($ = {}));
|
|
6613
|
+
//mol/promise/promise.ts
|
|
6614
|
+
;
|
|
6615
|
+
"use strict";
|
|
6616
|
+
var $;
|
|
6617
|
+
(function ($_1) {
|
|
6618
|
+
$mol_test_mocks.push($ => {
|
|
6619
|
+
$.$mol_after_timeout = $mol_after_mock_timeout;
|
|
6620
|
+
});
|
|
6621
|
+
})($ || ($ = {}));
|
|
6622
|
+
//mol/after/timeout/timeout.test.ts
|
|
6623
|
+
;
|
|
6624
|
+
"use strict";
|
|
6625
|
+
var $;
|
|
6626
|
+
(function ($) {
|
|
6627
|
+
function $mol_wire_sync(obj) {
|
|
6628
|
+
return new Proxy(obj, {
|
|
6629
|
+
get(obj, field) {
|
|
6630
|
+
const val = obj[field];
|
|
6631
|
+
if (typeof val !== 'function')
|
|
6632
|
+
return val;
|
|
6633
|
+
const temp = $mol_wire_task.getter(val);
|
|
6634
|
+
return function $mol_wire_sync(...args) {
|
|
6635
|
+
const fiber = temp(obj, args);
|
|
6636
|
+
return fiber.sync();
|
|
6637
|
+
};
|
|
6638
|
+
},
|
|
6639
|
+
apply(obj, self, args) {
|
|
6640
|
+
const temp = $mol_wire_task.getter(obj);
|
|
6641
|
+
const fiber = temp(self, args);
|
|
6642
|
+
return fiber.sync();
|
|
6643
|
+
},
|
|
6644
|
+
});
|
|
6645
|
+
}
|
|
6646
|
+
$.$mol_wire_sync = $mol_wire_sync;
|
|
6647
|
+
})($ || ($ = {}));
|
|
6648
|
+
//mol/wire/sync/sync.ts
|
|
6649
|
+
;
|
|
6650
|
+
"use strict";
|
|
6651
|
+
var $;
|
|
6652
|
+
(function ($) {
|
|
6653
|
+
function $mol_wait_timeout_async(timeout) {
|
|
6654
|
+
const promise = $mol_promise();
|
|
6655
|
+
const task = new this.$mol_after_timeout(timeout, () => promise.done());
|
|
6656
|
+
return Object.assign(promise, {
|
|
6657
|
+
destructor: () => task.destructor()
|
|
6658
|
+
});
|
|
6659
|
+
}
|
|
6660
|
+
$.$mol_wait_timeout_async = $mol_wait_timeout_async;
|
|
6661
|
+
function $mol_wait_timeout(timeout) {
|
|
6662
|
+
return this.$mol_wire_sync(this).$mol_wait_timeout_async(timeout);
|
|
6663
|
+
}
|
|
6664
|
+
$.$mol_wait_timeout = $mol_wait_timeout;
|
|
6665
|
+
})($ || ($ = {}));
|
|
6666
|
+
//mol/wait/timeout/timeout.ts
|
|
6667
|
+
;
|
|
6668
|
+
"use strict";
|
|
6669
|
+
var $;
|
|
6523
6670
|
(function ($_1) {
|
|
6524
6671
|
$mol_test({
|
|
6525
6672
|
async 'Latest Calls Wins on Concurrency'($) {
|
|
@@ -6541,6 +6688,15 @@ var $;
|
|
|
6541
6688
|
$mol_assert_like(NameLogger.first, ['john', 'jin']);
|
|
6542
6689
|
$mol_assert_like(NameLogger.last, ['jin']);
|
|
6543
6690
|
},
|
|
6691
|
+
async 'Wrap function'($) {
|
|
6692
|
+
const name = $mol_wire_async(function (name) {
|
|
6693
|
+
$.$mol_wait_timeout(0);
|
|
6694
|
+
return name;
|
|
6695
|
+
});
|
|
6696
|
+
const promise = name('jin');
|
|
6697
|
+
$.$mol_after_mock_warp();
|
|
6698
|
+
$mol_assert_like(await promise, 'jin');
|
|
6699
|
+
},
|
|
6544
6700
|
});
|
|
6545
6701
|
})($ || ($ = {}));
|
|
6546
6702
|
//mol/wire/async/async.test.ts
|
|
@@ -6605,15 +6761,6 @@ var $;
|
|
|
6605
6761
|
;
|
|
6606
6762
|
"use strict";
|
|
6607
6763
|
var $;
|
|
6608
|
-
(function ($_1) {
|
|
6609
|
-
$mol_test_mocks.push($ => {
|
|
6610
|
-
$.$mol_after_timeout = $mol_after_mock_timeout;
|
|
6611
|
-
});
|
|
6612
|
-
})($ || ($ = {}));
|
|
6613
|
-
//mol/after/timeout/timeout.test.ts
|
|
6614
|
-
;
|
|
6615
|
-
"use strict";
|
|
6616
|
-
var $;
|
|
6617
6764
|
(function ($_1) {
|
|
6618
6765
|
$mol_test_mocks.push($ => {
|
|
6619
6766
|
$.$mol_after_frame = $mol_after_mock_commmon;
|
|
@@ -6705,64 +6852,6 @@ var $;
|
|
|
6705
6852
|
;
|
|
6706
6853
|
"use strict";
|
|
6707
6854
|
var $;
|
|
6708
|
-
(function ($) {
|
|
6709
|
-
function $mol_wire_sync(obj) {
|
|
6710
|
-
return new Proxy(obj, {
|
|
6711
|
-
get(obj, field) {
|
|
6712
|
-
const val = obj[field];
|
|
6713
|
-
if (typeof val !== 'function')
|
|
6714
|
-
return val;
|
|
6715
|
-
const temp = $mol_wire_task.getter(val);
|
|
6716
|
-
return function $mol_wire_sync(...args) {
|
|
6717
|
-
const fiber = temp(obj, args);
|
|
6718
|
-
return fiber.sync();
|
|
6719
|
-
};
|
|
6720
|
-
}
|
|
6721
|
-
});
|
|
6722
|
-
}
|
|
6723
|
-
$.$mol_wire_sync = $mol_wire_sync;
|
|
6724
|
-
})($ || ($ = {}));
|
|
6725
|
-
//mol/wire/sync/sync.ts
|
|
6726
|
-
;
|
|
6727
|
-
"use strict";
|
|
6728
|
-
var $;
|
|
6729
|
-
(function ($) {
|
|
6730
|
-
function $mol_promise() {
|
|
6731
|
-
let done;
|
|
6732
|
-
let fail;
|
|
6733
|
-
const promise = new Promise((d, f) => {
|
|
6734
|
-
done = d;
|
|
6735
|
-
fail = f;
|
|
6736
|
-
});
|
|
6737
|
-
return Object.assign(promise, {
|
|
6738
|
-
done,
|
|
6739
|
-
fail,
|
|
6740
|
-
});
|
|
6741
|
-
}
|
|
6742
|
-
$.$mol_promise = $mol_promise;
|
|
6743
|
-
})($ || ($ = {}));
|
|
6744
|
-
//mol/promise/promise.ts
|
|
6745
|
-
;
|
|
6746
|
-
"use strict";
|
|
6747
|
-
var $;
|
|
6748
|
-
(function ($) {
|
|
6749
|
-
function $mol_wait_timeout_async(timeout) {
|
|
6750
|
-
const promise = $mol_promise();
|
|
6751
|
-
const task = new this.$mol_after_timeout(timeout, () => promise.done());
|
|
6752
|
-
return Object.assign(promise, {
|
|
6753
|
-
destructor: () => task.destructor()
|
|
6754
|
-
});
|
|
6755
|
-
}
|
|
6756
|
-
$.$mol_wait_timeout_async = $mol_wait_timeout_async;
|
|
6757
|
-
function $mol_wait_timeout(timeout) {
|
|
6758
|
-
return this.$mol_wire_sync(this).$mol_wait_timeout_async(timeout);
|
|
6759
|
-
}
|
|
6760
|
-
$.$mol_wait_timeout = $mol_wait_timeout;
|
|
6761
|
-
})($ || ($ = {}));
|
|
6762
|
-
//mol/wait/timeout/timeout.ts
|
|
6763
|
-
;
|
|
6764
|
-
"use strict";
|
|
6765
|
-
var $;
|
|
6766
6855
|
(function ($_1) {
|
|
6767
6856
|
$mol_test({
|
|
6768
6857
|
'Cached channel'($) {
|
|
@@ -7495,36 +7584,6 @@ var $;
|
|
|
7495
7584
|
;
|
|
7496
7585
|
"use strict";
|
|
7497
7586
|
var $;
|
|
7498
|
-
(function ($) {
|
|
7499
|
-
$mol_test({
|
|
7500
|
-
'const returns stored value'() {
|
|
7501
|
-
const foo = { bar: $mol_const(Math.random()) };
|
|
7502
|
-
$mol_assert_equal(foo.bar(), foo.bar());
|
|
7503
|
-
$mol_assert_equal(foo.bar(), foo.bar['()']);
|
|
7504
|
-
},
|
|
7505
|
-
});
|
|
7506
|
-
})($ || ($ = {}));
|
|
7507
|
-
//mol/const/const.test.ts
|
|
7508
|
-
;
|
|
7509
|
-
"use strict";
|
|
7510
|
-
var $;
|
|
7511
|
-
(function ($_1) {
|
|
7512
|
-
$mol_test({
|
|
7513
|
-
'FQN of anon function'($) {
|
|
7514
|
-
const $$ = Object.assign($, { $mol_func_name_test: (() => () => { })() });
|
|
7515
|
-
$mol_assert_equal($$.$mol_func_name_test.name, '');
|
|
7516
|
-
$mol_assert_equal($$.$mol_func_name($$.$mol_func_name_test), '$mol_func_name_test');
|
|
7517
|
-
$mol_assert_equal($$.$mol_func_name_test.name, '$mol_func_name_test');
|
|
7518
|
-
},
|
|
7519
|
-
});
|
|
7520
|
-
})($ || ($ = {}));
|
|
7521
|
-
//mol/func/name/name.test.ts
|
|
7522
|
-
;
|
|
7523
|
-
"use strict";
|
|
7524
|
-
//mol/type/keys/extract/extract.test.ts
|
|
7525
|
-
;
|
|
7526
|
-
"use strict";
|
|
7527
|
-
var $;
|
|
7528
7587
|
(function ($) {
|
|
7529
7588
|
class $mol_wire_log extends $mol_object2 {
|
|
7530
7589
|
static watch(task) {
|
|
@@ -7641,6 +7700,36 @@ var $;
|
|
|
7641
7700
|
;
|
|
7642
7701
|
"use strict";
|
|
7643
7702
|
var $;
|
|
7703
|
+
(function ($) {
|
|
7704
|
+
$mol_test({
|
|
7705
|
+
'const returns stored value'() {
|
|
7706
|
+
const foo = { bar: $mol_const(Math.random()) };
|
|
7707
|
+
$mol_assert_equal(foo.bar(), foo.bar());
|
|
7708
|
+
$mol_assert_equal(foo.bar(), foo.bar['()']);
|
|
7709
|
+
},
|
|
7710
|
+
});
|
|
7711
|
+
})($ || ($ = {}));
|
|
7712
|
+
//mol/const/const.test.ts
|
|
7713
|
+
;
|
|
7714
|
+
"use strict";
|
|
7715
|
+
var $;
|
|
7716
|
+
(function ($_1) {
|
|
7717
|
+
$mol_test({
|
|
7718
|
+
'FQN of anon function'($) {
|
|
7719
|
+
const $$ = Object.assign($, { $mol_func_name_test: (() => () => { })() });
|
|
7720
|
+
$mol_assert_equal($$.$mol_func_name_test.name, '');
|
|
7721
|
+
$mol_assert_equal($$.$mol_func_name($$.$mol_func_name_test), '$mol_func_name_test');
|
|
7722
|
+
$mol_assert_equal($$.$mol_func_name_test.name, '$mol_func_name_test');
|
|
7723
|
+
},
|
|
7724
|
+
});
|
|
7725
|
+
})($ || ($ = {}));
|
|
7726
|
+
//mol/func/name/name.test.ts
|
|
7727
|
+
;
|
|
7728
|
+
"use strict";
|
|
7729
|
+
//mol/type/keys/extract/extract.test.ts
|
|
7730
|
+
;
|
|
7731
|
+
"use strict";
|
|
7732
|
+
var $;
|
|
7644
7733
|
(function ($_1) {
|
|
7645
7734
|
$mol_test({
|
|
7646
7735
|
'id auto generation'($) {
|
|
@@ -8055,7 +8144,6 @@ var $;
|
|
|
8055
8144
|
"use strict";
|
|
8056
8145
|
var $;
|
|
8057
8146
|
(function ($) {
|
|
8058
|
-
const TextDecoder = globalThis.TextDecoder ?? $node.util.TextDecoder;
|
|
8059
8147
|
function $mol_charset_decode(value, code = 'utf8') {
|
|
8060
8148
|
return new TextDecoder(code).decode(value);
|
|
8061
8149
|
}
|