mol_plot_all 1.2.1477 → 1.2.1479
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 +4 -0
- package/node.d.ts.map +1 -1
- package/node.deps.json +1 -1
- package/node.js +122 -5
- package/node.js.map +1 -1
- package/node.mjs +122 -5
- package/node.test.js +136 -27
- package/node.test.js.map +1 -1
- package/package.json +2 -1
- package/web.d.ts +4 -0
- package/web.d.ts.map +1 -1
- package/web.deps.json +1 -1
- package/web.js +133 -4
- package/web.js.map +1 -1
- package/web.mjs +133 -4
- package/web.test.js +14 -22
- package/web.test.js.map +1 -1
package/node.mjs
CHANGED
|
@@ -390,6 +390,17 @@ var $;
|
|
|
390
390
|
$.$mol_dev_format_register = $mol_dev_format_register;
|
|
391
391
|
$.$mol_dev_format_head = Symbol('$mol_dev_format_head');
|
|
392
392
|
$.$mol_dev_format_body = Symbol('$mol_dev_format_body');
|
|
393
|
+
function $mol_dev_format_button(label, click) {
|
|
394
|
+
return $mol_dev_format_auto({
|
|
395
|
+
[$.$mol_dev_format_head]() {
|
|
396
|
+
return $mol_dev_format_span({ color: 'cornflowerblue' }, label);
|
|
397
|
+
},
|
|
398
|
+
[$.$mol_dev_format_body]() {
|
|
399
|
+
Promise.resolve().then(click);
|
|
400
|
+
return $mol_dev_format_span({});
|
|
401
|
+
}
|
|
402
|
+
});
|
|
403
|
+
}
|
|
393
404
|
$mol_dev_format_register({
|
|
394
405
|
header: (val, config = false) => {
|
|
395
406
|
if (config)
|
|
@@ -407,13 +418,41 @@ var $;
|
|
|
407
418
|
if (typeof val === 'function') {
|
|
408
419
|
return $mol_dev_format_native(val);
|
|
409
420
|
}
|
|
421
|
+
if (Error.isError(val)) {
|
|
422
|
+
return $mol_dev_format_span({}, $mol_dev_format_native(val), ' ', $mol_dev_format_button('throw', () => $mol_fail_hidden(val)));
|
|
423
|
+
}
|
|
424
|
+
if (val instanceof Promise) {
|
|
425
|
+
return $.$mol_dev_format_shade($mol_dev_format_native(val), ' ', val[Symbol.toStringTag] ?? '');
|
|
426
|
+
}
|
|
410
427
|
if (Symbol.toStringTag in val) {
|
|
411
428
|
return $mol_dev_format_native(val);
|
|
412
429
|
}
|
|
413
430
|
return null;
|
|
414
431
|
},
|
|
415
|
-
hasBody: val =>
|
|
416
|
-
|
|
432
|
+
hasBody: (val, config = false) => {
|
|
433
|
+
if (config)
|
|
434
|
+
return false;
|
|
435
|
+
if (!val)
|
|
436
|
+
return false;
|
|
437
|
+
if (val[$.$mol_dev_format_body])
|
|
438
|
+
return true;
|
|
439
|
+
return false;
|
|
440
|
+
},
|
|
441
|
+
body: (val, config = false) => {
|
|
442
|
+
if (config)
|
|
443
|
+
return null;
|
|
444
|
+
if (!val)
|
|
445
|
+
return null;
|
|
446
|
+
if ($.$mol_dev_format_body in val) {
|
|
447
|
+
try {
|
|
448
|
+
return val[$.$mol_dev_format_body]();
|
|
449
|
+
}
|
|
450
|
+
catch (error) {
|
|
451
|
+
return $.$mol_dev_format_accent($mol_dev_format_native(val), '💨', $mol_dev_format_native(error), '');
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
return null;
|
|
455
|
+
},
|
|
417
456
|
});
|
|
418
457
|
function $mol_dev_format_native(obj) {
|
|
419
458
|
if (typeof obj === 'undefined')
|
|
@@ -479,6 +518,69 @@ var $;
|
|
|
479
518
|
$.$mol_dev_format_indent = $.$mol_dev_format_div.bind(null, {
|
|
480
519
|
'margin-left': '13px'
|
|
481
520
|
});
|
|
521
|
+
class Stack extends Array {
|
|
522
|
+
toString() {
|
|
523
|
+
return this.join('\n');
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
class Call extends Object {
|
|
527
|
+
type;
|
|
528
|
+
function;
|
|
529
|
+
method;
|
|
530
|
+
eval;
|
|
531
|
+
source;
|
|
532
|
+
offset;
|
|
533
|
+
pos;
|
|
534
|
+
object;
|
|
535
|
+
flags;
|
|
536
|
+
[Symbol.toStringTag];
|
|
537
|
+
constructor(call) {
|
|
538
|
+
super();
|
|
539
|
+
this.type = call.getTypeName() ?? '';
|
|
540
|
+
this.function = call.getFunctionName() ?? '';
|
|
541
|
+
this.method = call.getMethodName() ?? '';
|
|
542
|
+
if (this.method === this.function)
|
|
543
|
+
this.method = '';
|
|
544
|
+
this.pos = [call.getEnclosingLineNumber() ?? 0, call.getEnclosingColumnNumber() ?? 0];
|
|
545
|
+
this.eval = call.getEvalOrigin() ?? '';
|
|
546
|
+
this.source = call.getScriptNameOrSourceURL() ?? '';
|
|
547
|
+
this.object = call.getThis();
|
|
548
|
+
this.offset = call.getPosition();
|
|
549
|
+
const flags = [];
|
|
550
|
+
if (call.isAsync())
|
|
551
|
+
flags.push('async');
|
|
552
|
+
if (call.isConstructor())
|
|
553
|
+
flags.push('constructor');
|
|
554
|
+
if (call.isEval())
|
|
555
|
+
flags.push('eval');
|
|
556
|
+
if (call.isNative())
|
|
557
|
+
flags.push('native');
|
|
558
|
+
if (call.isPromiseAll())
|
|
559
|
+
flags.push('PromiseAll');
|
|
560
|
+
if (call.isToplevel())
|
|
561
|
+
flags.push('top');
|
|
562
|
+
this.flags = flags;
|
|
563
|
+
const type = this.type ? this.type + '.' : '';
|
|
564
|
+
const func = this.function || '<anon>';
|
|
565
|
+
const method = this.method ? ' [' + this.method + '] ' : '';
|
|
566
|
+
this[Symbol.toStringTag] = `${type}${func}${method}`;
|
|
567
|
+
}
|
|
568
|
+
[Symbol.toPrimitive]() {
|
|
569
|
+
return this.toString();
|
|
570
|
+
}
|
|
571
|
+
toString() {
|
|
572
|
+
const object = this.object || '';
|
|
573
|
+
const label = this[Symbol.toStringTag];
|
|
574
|
+
const source = `${this.source}:${this.pos.join(':')} #${this.offset}`;
|
|
575
|
+
return `\tat ${object}${label} (${source})`;
|
|
576
|
+
}
|
|
577
|
+
[$.$mol_dev_format_head]() {
|
|
578
|
+
return $.$mol_dev_format_div({}, $mol_dev_format_native(this), $.$mol_dev_format_shade(' '), ...this.object ? [
|
|
579
|
+
$mol_dev_format_native(this.object),
|
|
580
|
+
] : [], ...this.method ? [$.$mol_dev_format_shade(' ', ' [', this.method, ']')] : [], $.$mol_dev_format_shade(' ', this.flags.join(', ')));
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
Error.prepareStackTrace ??= (error, stack) => new Stack(...stack.map(call => new Call(call)));
|
|
482
584
|
})($ || ($ = {}));
|
|
483
585
|
|
|
484
586
|
;
|
|
@@ -1026,7 +1128,7 @@ var $;
|
|
|
1026
1128
|
if (left instanceof RegExp)
|
|
1027
1129
|
return left.source === right.source && left.flags === right.flags;
|
|
1028
1130
|
if (left instanceof Error)
|
|
1029
|
-
return left.message === right.message && left.stack
|
|
1131
|
+
return left.message === right.message && $mol_compare_deep(left.stack, right.stack);
|
|
1030
1132
|
let left_cache = $.$mol_compare_deep_cache.get(left);
|
|
1031
1133
|
if (left_cache) {
|
|
1032
1134
|
const right_cache = left_cache.get(right);
|
|
@@ -1788,6 +1890,21 @@ var $;
|
|
|
1788
1890
|
$.$mol_fail_catch = $mol_fail_catch;
|
|
1789
1891
|
})($ || ($ = {}));
|
|
1790
1892
|
|
|
1893
|
+
;
|
|
1894
|
+
"use strict";
|
|
1895
|
+
var $;
|
|
1896
|
+
(function ($) {
|
|
1897
|
+
function $mol_try(handler) {
|
|
1898
|
+
try {
|
|
1899
|
+
return handler();
|
|
1900
|
+
}
|
|
1901
|
+
catch (error) {
|
|
1902
|
+
return error;
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
$.$mol_try = $mol_try;
|
|
1906
|
+
})($ || ($ = {}));
|
|
1907
|
+
|
|
1791
1908
|
;
|
|
1792
1909
|
"use strict";
|
|
1793
1910
|
var $;
|
|
@@ -1797,7 +1914,7 @@ var $;
|
|
|
1797
1914
|
return false;
|
|
1798
1915
|
if (!$mol_fail_catch(error))
|
|
1799
1916
|
return false;
|
|
1800
|
-
|
|
1917
|
+
$mol_try(() => { $mol_fail_hidden(error); });
|
|
1801
1918
|
return true;
|
|
1802
1919
|
}
|
|
1803
1920
|
$.$mol_fail_log = $mol_fail_log;
|
|
@@ -2101,7 +2218,7 @@ var $;
|
|
|
2101
2218
|
get: () => stack_get() + '\n' + [
|
|
2102
2219
|
this.cause ?? 'no cause',
|
|
2103
2220
|
...this.errors.flatMap(e => [
|
|
2104
|
-
e.stack,
|
|
2221
|
+
String(e.stack),
|
|
2105
2222
|
...e instanceof $mol_error_mix || !e.cause ? [] : [e.cause]
|
|
2106
2223
|
])
|
|
2107
2224
|
].map(frame_normalize).join('\n')
|
package/node.test.js
CHANGED
|
@@ -381,6 +381,17 @@ var $;
|
|
|
381
381
|
$.$mol_dev_format_register = $mol_dev_format_register;
|
|
382
382
|
$.$mol_dev_format_head = Symbol('$mol_dev_format_head');
|
|
383
383
|
$.$mol_dev_format_body = Symbol('$mol_dev_format_body');
|
|
384
|
+
function $mol_dev_format_button(label, click) {
|
|
385
|
+
return $mol_dev_format_auto({
|
|
386
|
+
[$.$mol_dev_format_head]() {
|
|
387
|
+
return $mol_dev_format_span({ color: 'cornflowerblue' }, label);
|
|
388
|
+
},
|
|
389
|
+
[$.$mol_dev_format_body]() {
|
|
390
|
+
Promise.resolve().then(click);
|
|
391
|
+
return $mol_dev_format_span({});
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
}
|
|
384
395
|
$mol_dev_format_register({
|
|
385
396
|
header: (val, config = false) => {
|
|
386
397
|
if (config)
|
|
@@ -398,13 +409,41 @@ var $;
|
|
|
398
409
|
if (typeof val === 'function') {
|
|
399
410
|
return $mol_dev_format_native(val);
|
|
400
411
|
}
|
|
412
|
+
if (Error.isError(val)) {
|
|
413
|
+
return $mol_dev_format_span({}, $mol_dev_format_native(val), ' ', $mol_dev_format_button('throw', () => $mol_fail_hidden(val)));
|
|
414
|
+
}
|
|
415
|
+
if (val instanceof Promise) {
|
|
416
|
+
return $.$mol_dev_format_shade($mol_dev_format_native(val), ' ', val[Symbol.toStringTag] ?? '');
|
|
417
|
+
}
|
|
401
418
|
if (Symbol.toStringTag in val) {
|
|
402
419
|
return $mol_dev_format_native(val);
|
|
403
420
|
}
|
|
404
421
|
return null;
|
|
405
422
|
},
|
|
406
|
-
hasBody: val =>
|
|
407
|
-
|
|
423
|
+
hasBody: (val, config = false) => {
|
|
424
|
+
if (config)
|
|
425
|
+
return false;
|
|
426
|
+
if (!val)
|
|
427
|
+
return false;
|
|
428
|
+
if (val[$.$mol_dev_format_body])
|
|
429
|
+
return true;
|
|
430
|
+
return false;
|
|
431
|
+
},
|
|
432
|
+
body: (val, config = false) => {
|
|
433
|
+
if (config)
|
|
434
|
+
return null;
|
|
435
|
+
if (!val)
|
|
436
|
+
return null;
|
|
437
|
+
if ($.$mol_dev_format_body in val) {
|
|
438
|
+
try {
|
|
439
|
+
return val[$.$mol_dev_format_body]();
|
|
440
|
+
}
|
|
441
|
+
catch (error) {
|
|
442
|
+
return $.$mol_dev_format_accent($mol_dev_format_native(val), '💨', $mol_dev_format_native(error), '');
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
return null;
|
|
446
|
+
},
|
|
408
447
|
});
|
|
409
448
|
function $mol_dev_format_native(obj) {
|
|
410
449
|
if (typeof obj === 'undefined')
|
|
@@ -470,6 +509,69 @@ var $;
|
|
|
470
509
|
$.$mol_dev_format_indent = $.$mol_dev_format_div.bind(null, {
|
|
471
510
|
'margin-left': '13px'
|
|
472
511
|
});
|
|
512
|
+
class Stack extends Array {
|
|
513
|
+
toString() {
|
|
514
|
+
return this.join('\n');
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
class Call extends Object {
|
|
518
|
+
type;
|
|
519
|
+
function;
|
|
520
|
+
method;
|
|
521
|
+
eval;
|
|
522
|
+
source;
|
|
523
|
+
offset;
|
|
524
|
+
pos;
|
|
525
|
+
object;
|
|
526
|
+
flags;
|
|
527
|
+
[Symbol.toStringTag];
|
|
528
|
+
constructor(call) {
|
|
529
|
+
super();
|
|
530
|
+
this.type = call.getTypeName() ?? '';
|
|
531
|
+
this.function = call.getFunctionName() ?? '';
|
|
532
|
+
this.method = call.getMethodName() ?? '';
|
|
533
|
+
if (this.method === this.function)
|
|
534
|
+
this.method = '';
|
|
535
|
+
this.pos = [call.getEnclosingLineNumber() ?? 0, call.getEnclosingColumnNumber() ?? 0];
|
|
536
|
+
this.eval = call.getEvalOrigin() ?? '';
|
|
537
|
+
this.source = call.getScriptNameOrSourceURL() ?? '';
|
|
538
|
+
this.object = call.getThis();
|
|
539
|
+
this.offset = call.getPosition();
|
|
540
|
+
const flags = [];
|
|
541
|
+
if (call.isAsync())
|
|
542
|
+
flags.push('async');
|
|
543
|
+
if (call.isConstructor())
|
|
544
|
+
flags.push('constructor');
|
|
545
|
+
if (call.isEval())
|
|
546
|
+
flags.push('eval');
|
|
547
|
+
if (call.isNative())
|
|
548
|
+
flags.push('native');
|
|
549
|
+
if (call.isPromiseAll())
|
|
550
|
+
flags.push('PromiseAll');
|
|
551
|
+
if (call.isToplevel())
|
|
552
|
+
flags.push('top');
|
|
553
|
+
this.flags = flags;
|
|
554
|
+
const type = this.type ? this.type + '.' : '';
|
|
555
|
+
const func = this.function || '<anon>';
|
|
556
|
+
const method = this.method ? ' [' + this.method + '] ' : '';
|
|
557
|
+
this[Symbol.toStringTag] = `${type}${func}${method}`;
|
|
558
|
+
}
|
|
559
|
+
[Symbol.toPrimitive]() {
|
|
560
|
+
return this.toString();
|
|
561
|
+
}
|
|
562
|
+
toString() {
|
|
563
|
+
const object = this.object || '';
|
|
564
|
+
const label = this[Symbol.toStringTag];
|
|
565
|
+
const source = `${this.source}:${this.pos.join(':')} #${this.offset}`;
|
|
566
|
+
return `\tat ${object}${label} (${source})`;
|
|
567
|
+
}
|
|
568
|
+
[$.$mol_dev_format_head]() {
|
|
569
|
+
return $.$mol_dev_format_div({}, $mol_dev_format_native(this), $.$mol_dev_format_shade(' '), ...this.object ? [
|
|
570
|
+
$mol_dev_format_native(this.object),
|
|
571
|
+
] : [], ...this.method ? [$.$mol_dev_format_shade(' ', ' [', this.method, ']')] : [], $.$mol_dev_format_shade(' ', this.flags.join(', ')));
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
Error.prepareStackTrace ??= (error, stack) => new Stack(...stack.map(call => new Call(call)));
|
|
473
575
|
})($ || ($ = {}));
|
|
474
576
|
|
|
475
577
|
;
|
|
@@ -1017,7 +1119,7 @@ var $;
|
|
|
1017
1119
|
if (left instanceof RegExp)
|
|
1018
1120
|
return left.source === right.source && left.flags === right.flags;
|
|
1019
1121
|
if (left instanceof Error)
|
|
1020
|
-
return left.message === right.message && left.stack
|
|
1122
|
+
return left.message === right.message && $mol_compare_deep(left.stack, right.stack);
|
|
1021
1123
|
let left_cache = $.$mol_compare_deep_cache.get(left);
|
|
1022
1124
|
if (left_cache) {
|
|
1023
1125
|
const right_cache = left_cache.get(right);
|
|
@@ -1779,6 +1881,21 @@ var $;
|
|
|
1779
1881
|
$.$mol_fail_catch = $mol_fail_catch;
|
|
1780
1882
|
})($ || ($ = {}));
|
|
1781
1883
|
|
|
1884
|
+
;
|
|
1885
|
+
"use strict";
|
|
1886
|
+
var $;
|
|
1887
|
+
(function ($) {
|
|
1888
|
+
function $mol_try(handler) {
|
|
1889
|
+
try {
|
|
1890
|
+
return handler();
|
|
1891
|
+
}
|
|
1892
|
+
catch (error) {
|
|
1893
|
+
return error;
|
|
1894
|
+
}
|
|
1895
|
+
}
|
|
1896
|
+
$.$mol_try = $mol_try;
|
|
1897
|
+
})($ || ($ = {}));
|
|
1898
|
+
|
|
1782
1899
|
;
|
|
1783
1900
|
"use strict";
|
|
1784
1901
|
var $;
|
|
@@ -1788,7 +1905,7 @@ var $;
|
|
|
1788
1905
|
return false;
|
|
1789
1906
|
if (!$mol_fail_catch(error))
|
|
1790
1907
|
return false;
|
|
1791
|
-
|
|
1908
|
+
$mol_try(() => { $mol_fail_hidden(error); });
|
|
1792
1909
|
return true;
|
|
1793
1910
|
}
|
|
1794
1911
|
$.$mol_fail_log = $mol_fail_log;
|
|
@@ -2092,7 +2209,7 @@ var $;
|
|
|
2092
2209
|
get: () => stack_get() + '\n' + [
|
|
2093
2210
|
this.cause ?? 'no cause',
|
|
2094
2211
|
...this.errors.flatMap(e => [
|
|
2095
|
-
e.stack,
|
|
2212
|
+
String(e.stack),
|
|
2096
2213
|
...e instanceof $mol_error_mix || !e.cause ? [] : [e.cause]
|
|
2097
2214
|
])
|
|
2098
2215
|
].map(frame_normalize).join('\n')
|
|
@@ -6470,6 +6587,17 @@ var $;
|
|
|
6470
6587
|
$.$mol_test_complete = $mol_test_complete;
|
|
6471
6588
|
})($ || ($ = {}));
|
|
6472
6589
|
|
|
6590
|
+
;
|
|
6591
|
+
"use strict";
|
|
6592
|
+
var $;
|
|
6593
|
+
(function ($) {
|
|
6594
|
+
$mol_test({
|
|
6595
|
+
'return result without errors'() {
|
|
6596
|
+
$mol_assert_equal($mol_try(() => false), false);
|
|
6597
|
+
},
|
|
6598
|
+
});
|
|
6599
|
+
})($ || ($ = {}));
|
|
6600
|
+
|
|
6473
6601
|
;
|
|
6474
6602
|
"use strict";
|
|
6475
6603
|
var $;
|
|
@@ -7185,7 +7313,7 @@ var $;
|
|
|
7185
7313
|
catch (error) {
|
|
7186
7314
|
$.$mol_fail = fail;
|
|
7187
7315
|
if (typeof ErrorRight === 'string') {
|
|
7188
|
-
$mol_assert_equal(error.message, ErrorRight);
|
|
7316
|
+
$mol_assert_equal(error.message ?? error, ErrorRight);
|
|
7189
7317
|
}
|
|
7190
7318
|
else {
|
|
7191
7319
|
$mol_assert_equal(error instanceof ErrorRight, true);
|
|
@@ -7209,7 +7337,7 @@ var $;
|
|
|
7209
7337
|
continue;
|
|
7210
7338
|
if (!$mol_compare_deep(args[i], args[j]))
|
|
7211
7339
|
continue;
|
|
7212
|
-
$mol_fail(new Error(`
|
|
7340
|
+
return $mol_fail(new Error(`Uniquesess assertion failure`, { cause: { [i]: args[i], [i]: args[i] } }));
|
|
7213
7341
|
}
|
|
7214
7342
|
}
|
|
7215
7343
|
}
|
|
@@ -7220,29 +7348,10 @@ var $;
|
|
|
7220
7348
|
continue;
|
|
7221
7349
|
if (args[0] instanceof $mol_dom_context.Element && args[i] instanceof $mol_dom_context.Element && args[0].outerHTML === args[i].outerHTML)
|
|
7222
7350
|
continue;
|
|
7223
|
-
return $mol_fail(new Error(`args[0]
|
|
7351
|
+
return $mol_fail(new Error(`Equality assertion failure`, { cause: { 0: args[0], [i]: args[i] } }));
|
|
7224
7352
|
}
|
|
7225
7353
|
}
|
|
7226
7354
|
$.$mol_assert_equal = $mol_assert_equal;
|
|
7227
|
-
const print = (val) => {
|
|
7228
|
-
if (!val)
|
|
7229
|
-
return val;
|
|
7230
|
-
if (typeof val === 'bigint')
|
|
7231
|
-
return String(val) + 'n';
|
|
7232
|
-
if (typeof val === 'symbol')
|
|
7233
|
-
return `Symbol(${val.description})`;
|
|
7234
|
-
if (typeof val !== 'object')
|
|
7235
|
-
return val;
|
|
7236
|
-
if ('outerHTML' in val)
|
|
7237
|
-
return val.outerHTML;
|
|
7238
|
-
try {
|
|
7239
|
-
return JSON.stringify(val, (k, v) => typeof v === 'bigint' ? String(v) : v, '\t');
|
|
7240
|
-
}
|
|
7241
|
-
catch (error) {
|
|
7242
|
-
console.error(error);
|
|
7243
|
-
return val;
|
|
7244
|
-
}
|
|
7245
|
-
};
|
|
7246
7355
|
})($ || ($ = {}));
|
|
7247
7356
|
|
|
7248
7357
|
;
|