mol_plot_all 1.2.523 → 1.2.524

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/web.test.js CHANGED
@@ -97,25 +97,25 @@ var $;
97
97
  //mol/test/test.web.test.ts
98
98
  ;
99
99
  "use strict";
100
- //mol/type/error/error.ts
100
+ //mol/type/partial/deep/deep.ts
101
101
  ;
102
102
  "use strict";
103
- //mol/type/assert/assert.test.ts
103
+ //mol/type/error/error.ts
104
104
  ;
105
105
  "use strict";
106
106
  //mol/type/assert/assert.ts
107
107
  ;
108
108
  "use strict";
109
- //mol/type/equals/equals.test.ts
109
+ //mol/type/assert/assert.test.ts
110
110
  ;
111
111
  "use strict";
112
112
  //mol/type/equals/equals.ts
113
113
  ;
114
114
  "use strict";
115
- //mol/type/partial/deep/deep.test.ts
115
+ //mol/type/equals/equals.test.ts
116
116
  ;
117
117
  "use strict";
118
- //mol/type/partial/deep/deep.ts
118
+ //mol/type/partial/deep/deep.test.ts
119
119
  ;
120
120
  "use strict";
121
121
  var $;
@@ -437,38 +437,6 @@ var $;
437
437
  ;
438
438
  "use strict";
439
439
  var $;
440
- (function ($) {
441
- $mol_test({
442
- 'must be false'() {
443
- $mol_assert_not(0);
444
- },
445
- 'must be true'() {
446
- $mol_assert_ok(1);
447
- },
448
- 'two must be equal'() {
449
- $mol_assert_equal(2, 2);
450
- },
451
- 'three must be equal'() {
452
- $mol_assert_equal(2, 2, 2);
453
- },
454
- 'two must be unique'() {
455
- $mol_assert_unique([3], [3]);
456
- },
457
- 'three must be unique'() {
458
- $mol_assert_unique([3], [3], [3]);
459
- },
460
- 'two must be alike'() {
461
- $mol_assert_like([3], [3]);
462
- },
463
- 'three must be alike'() {
464
- $mol_assert_like([3], [3], [3]);
465
- },
466
- });
467
- })($ || ($ = {}));
468
- //mol/assert/assert.test.ts
469
- ;
470
- "use strict";
471
- var $;
472
440
  (function ($) {
473
441
  function $mol_assert_ok(value) {
474
442
  if (value)
@@ -563,6 +531,108 @@ var $;
563
531
  ;
564
532
  "use strict";
565
533
  var $;
534
+ (function ($) {
535
+ $mol_test({
536
+ 'must be false'() {
537
+ $mol_assert_not(0);
538
+ },
539
+ 'must be true'() {
540
+ $mol_assert_ok(1);
541
+ },
542
+ 'two must be equal'() {
543
+ $mol_assert_equal(2, 2);
544
+ },
545
+ 'three must be equal'() {
546
+ $mol_assert_equal(2, 2, 2);
547
+ },
548
+ 'two must be unique'() {
549
+ $mol_assert_unique([3], [3]);
550
+ },
551
+ 'three must be unique'() {
552
+ $mol_assert_unique([3], [3], [3]);
553
+ },
554
+ 'two must be alike'() {
555
+ $mol_assert_like([3], [3]);
556
+ },
557
+ 'three must be alike'() {
558
+ $mol_assert_like([3], [3], [3]);
559
+ },
560
+ });
561
+ })($ || ($ = {}));
562
+ //mol/assert/assert.test.ts
563
+ ;
564
+ "use strict";
565
+ var $;
566
+ (function ($) {
567
+ function $mol_log3_area_lazy(event) {
568
+ const self = this;
569
+ const stack = self.$mol_log3_stack;
570
+ const deep = stack.length;
571
+ let logged = false;
572
+ stack.push(() => {
573
+ logged = true;
574
+ self.$mol_log3_area.call(self, event);
575
+ });
576
+ return () => {
577
+ if (logged)
578
+ self.console.groupEnd();
579
+ if (stack.length > deep)
580
+ stack.length = deep;
581
+ };
582
+ }
583
+ $.$mol_log3_area_lazy = $mol_log3_area_lazy;
584
+ $.$mol_log3_stack = [];
585
+ })($ || ($ = {}));
586
+ //mol/log3/log3.ts
587
+ ;
588
+ "use strict";
589
+ //mol/type/keys/extract/extract.test.ts
590
+ ;
591
+ "use strict";
592
+ var $;
593
+ (function ($_1) {
594
+ $mol_test_mocks.push($ => {
595
+ $.$mol_log3_come = () => { };
596
+ $.$mol_log3_done = () => { };
597
+ $.$mol_log3_fail = () => { };
598
+ $.$mol_log3_warn = () => { };
599
+ $.$mol_log3_rise = () => { };
600
+ $.$mol_log3_area = () => () => { };
601
+ });
602
+ })($ || ($ = {}));
603
+ //mol/log3/log3.test.ts
604
+ ;
605
+ "use strict";
606
+ var $;
607
+ (function ($) {
608
+ function $mol_log3_web_make(level, color) {
609
+ return function $mol_log3_logger(event) {
610
+ const pending = this.$mol_log3_stack.pop();
611
+ if (pending)
612
+ pending();
613
+ let tpl = '%c';
614
+ const chunks = Object.values(event);
615
+ for (let i = 0; i < chunks.length; ++i) {
616
+ tpl += (typeof chunks[i] === 'string') ? ' ⦙ %s' : ' ⦙ %o';
617
+ }
618
+ const style = `color:${color};font-weight:bolder`;
619
+ this.console[level](tpl, style, ...chunks);
620
+ const self = this;
621
+ return () => self.console.groupEnd();
622
+ };
623
+ }
624
+ $.$mol_log3_web_make = $mol_log3_web_make;
625
+ $.$mol_log3_come = $mol_log3_web_make('info', 'royalblue');
626
+ $.$mol_log3_done = $mol_log3_web_make('info', 'forestgreen');
627
+ $.$mol_log3_fail = $mol_log3_web_make('error', 'orangered');
628
+ $.$mol_log3_warn = $mol_log3_web_make('warn', 'goldenrod');
629
+ $.$mol_log3_rise = $mol_log3_web_make('log', 'magenta');
630
+ $.$mol_log3_area = $mol_log3_web_make('group', 'cyan');
631
+ })($ || ($ = {}));
632
+ //mol/log3/log3.web.ts
633
+ ;
634
+ "use strict";
635
+ var $;
566
636
  (function ($_1) {
567
637
  $mol_test({
568
638
  'FQN of anon function'($) {
@@ -681,82 +751,31 @@ var $;
681
751
  ;
682
752
  "use strict";
683
753
  var $;
684
- (function ($) {
685
- function $mol_log3_area_lazy(event) {
686
- const self = this;
687
- const stack = self.$mol_log3_stack;
688
- const deep = stack.length;
689
- let logged = false;
690
- stack.push(() => {
691
- logged = true;
692
- self.$mol_log3_area.call(self, event);
693
- });
694
- return () => {
695
- if (logged)
696
- self.console.groupEnd();
697
- if (stack.length > deep)
698
- stack.length = deep;
699
- };
700
- }
701
- $.$mol_log3_area_lazy = $mol_log3_area_lazy;
702
- $.$mol_log3_stack = [];
703
- })($ || ($ = {}));
704
- //mol/log3/log3.ts
705
- ;
706
- "use strict";
707
- //mol/type/keys/extract/extract.test.ts
708
- ;
709
- "use strict";
710
- var $;
711
754
  (function ($_1) {
712
755
  $mol_test_mocks.push($ => {
713
- $.$mol_log3_come = () => { };
714
- $.$mol_log3_done = () => { };
715
- $.$mol_log3_fail = () => { };
716
- $.$mol_log3_warn = () => { };
717
- $.$mol_log3_rise = () => { };
718
- $.$mol_log3_area = () => () => { };
756
+ $.$mol_after_tick = $mol_after_mock_commmon;
719
757
  });
720
758
  })($ || ($ = {}));
721
- //mol/log3/log3.test.ts
759
+ //mol/after/tick/tick.test.ts
722
760
  ;
723
761
  "use strict";
724
762
  var $;
725
763
  (function ($) {
726
- function $mol_log3_web_make(level, color) {
727
- return function $mol_log3_logger(event) {
728
- const pending = this.$mol_log3_stack.pop();
729
- if (pending)
730
- pending();
731
- let tpl = '%c';
732
- const chunks = Object.values(event);
733
- for (let i = 0; i < chunks.length; ++i) {
734
- tpl += (typeof chunks[i] === 'string') ? ' ⦙ %s' : ' ⦙ %o';
764
+ $mol_test({
765
+ 'init with overload'() {
766
+ class X extends $mol_object {
767
+ foo() {
768
+ return 1;
769
+ }
735
770
  }
736
- const style = `color:${color};font-weight:bolder`;
737
- this.console[level](tpl, style, ...chunks);
738
- const self = this;
739
- return () => self.console.groupEnd();
740
- };
741
- }
742
- $.$mol_log3_web_make = $mol_log3_web_make;
743
- $.$mol_log3_come = $mol_log3_web_make('info', 'royalblue');
744
- $.$mol_log3_done = $mol_log3_web_make('info', 'forestgreen');
745
- $.$mol_log3_fail = $mol_log3_web_make('error', 'orangered');
746
- $.$mol_log3_warn = $mol_log3_web_make('warn', 'goldenrod');
747
- $.$mol_log3_rise = $mol_log3_web_make('log', 'magenta');
748
- $.$mol_log3_area = $mol_log3_web_make('group', 'cyan');
749
- })($ || ($ = {}));
750
- //mol/log3/log3.web.ts
751
- ;
752
- "use strict";
753
- var $;
754
- (function ($_1) {
755
- $mol_test_mocks.push($ => {
756
- $.$mol_after_tick = $mol_after_mock_commmon;
771
+ var x = X.make({
772
+ foo: () => 2,
773
+ });
774
+ $mol_assert_equal(x.foo(), 2);
775
+ },
757
776
  });
758
777
  })($ || ($ = {}));
759
- //mol/after/tick/tick.test.ts
778
+ //mol/object/object.test.ts
760
779
  ;
761
780
  "use strict";
762
781
  var $;
@@ -908,6 +927,9 @@ var $;
908
927
  //mol/wire/fiber/fiber.test.ts
909
928
  ;
910
929
  "use strict";
930
+ //mol/type/tail/tail.test.ts
931
+ ;
932
+ "use strict";
911
933
  var $;
912
934
  (function ($) {
913
935
  function $mol_promise() {
@@ -1023,9 +1045,6 @@ var $;
1023
1045
  //mol/wire/async/async.test.ts
1024
1046
  ;
1025
1047
  "use strict";
1026
- //mol/type/tail/tail.test.ts
1027
- ;
1028
- "use strict";
1029
1048
  var $;
1030
1049
  (function ($_1) {
1031
1050
  $mol_test({
@@ -1618,28 +1637,140 @@ var $;
1618
1637
  var $;
1619
1638
  (function ($) {
1620
1639
  $mol_test({
1621
- 'init with overload'() {
1622
- class X extends $mol_object {
1623
- foo() {
1624
- return 1;
1625
- }
1626
- }
1627
- var x = X.make({
1628
- foo: () => 2,
1629
- });
1630
- $mol_assert_equal(x.foo(), 2);
1640
+ 'Primitives'() {
1641
+ $mol_assert_equal($mol_key(null), 'null');
1642
+ $mol_assert_equal($mol_key(false), 'false');
1643
+ $mol_assert_equal($mol_key(true), 'true');
1644
+ $mol_assert_equal($mol_key(0), '0');
1645
+ $mol_assert_equal($mol_key(''), '""');
1631
1646
  },
1632
- });
1633
- })($ || ($ = {}));
1634
- //mol/object/object.test.ts
1635
- ;
1636
- "use strict";
1637
- var $;
1638
- (function ($) {
1639
- $mol_test({
1640
- 'all cases of using maybe'() {
1641
- $mol_assert_equal($mol_maybe(0)[0], 0);
1642
- $mol_assert_equal($mol_maybe(false)[0], false);
1647
+ 'Array & POJO'() {
1648
+ $mol_assert_equal($mol_key([null]), '[null]');
1649
+ $mol_assert_equal($mol_key({ foo: 0 }), '{"foo":0}');
1650
+ $mol_assert_equal($mol_key({ foo: [false] }), '{"foo":[false]}');
1651
+ },
1652
+ 'Function'() {
1653
+ const func = () => { };
1654
+ $mol_assert_equal($mol_key(func), $mol_key(func));
1655
+ $mol_assert_unique($mol_key(func), $mol_key(() => { }));
1656
+ },
1657
+ 'Objects'() {
1658
+ class User {
1659
+ }
1660
+ const jin = new User();
1661
+ $mol_assert_equal($mol_key(jin), $mol_key(jin));
1662
+ $mol_assert_unique($mol_key(jin), $mol_key(new User()));
1663
+ },
1664
+ 'Elements'() {
1665
+ const foo = $mol_jsx("div", null, "bar");
1666
+ $mol_assert_equal($mol_key(foo), $mol_key(foo));
1667
+ $mol_assert_unique($mol_key(foo), $mol_key($mol_jsx("div", null, "bar")));
1668
+ },
1669
+ 'Custom JSON representation'() {
1670
+ class User {
1671
+ name;
1672
+ age;
1673
+ constructor(name, age) {
1674
+ this.name = name;
1675
+ this.age = age;
1676
+ }
1677
+ toJSON() { return { name: this.name }; }
1678
+ }
1679
+ $mol_assert_equal($mol_key(new User('jin', 18)), '{"name":"jin"}');
1680
+ },
1681
+ 'Special native classes'() {
1682
+ $mol_assert_equal($mol_key(new Date('xyz')), 'null');
1683
+ $mol_assert_equal($mol_key(new Date('2001-01-02T03:04:05.678Z')), '"2001-01-02T03:04:05.678Z"');
1684
+ $mol_assert_equal($mol_key(/./), '"/./"');
1685
+ $mol_assert_equal($mol_key(/\./gimsu), '"/\\\\./gimsu"');
1686
+ },
1687
+ });
1688
+ })($ || ($ = {}));
1689
+ //mol/key/key.test.tsx
1690
+ ;
1691
+ "use strict";
1692
+ //mol/type/foot/foot.test.ts
1693
+ ;
1694
+ "use strict";
1695
+ var $;
1696
+ (function ($) {
1697
+ class $mol_wire_log extends $mol_object2 {
1698
+ static watch(task) {
1699
+ return task;
1700
+ }
1701
+ static track(fiber) {
1702
+ const prev = $mol_wire_probe(() => this.track(fiber));
1703
+ let next;
1704
+ try {
1705
+ next = fiber.sync();
1706
+ }
1707
+ finally {
1708
+ for (const pub of fiber.pub_list) {
1709
+ if (pub instanceof $mol_wire_fiber) {
1710
+ this.track(pub);
1711
+ }
1712
+ }
1713
+ }
1714
+ if (fiber.host === this)
1715
+ return next;
1716
+ if ($mol_compare_deep(prev, next)) {
1717
+ this.$.$mol_log3_rise({
1718
+ message: '💧 Same',
1719
+ place: fiber,
1720
+ });
1721
+ }
1722
+ else if (prev !== undefined) {
1723
+ this.$.$mol_log3_rise({
1724
+ message: '🔥 Next',
1725
+ place: fiber,
1726
+ prev,
1727
+ });
1728
+ }
1729
+ return next;
1730
+ }
1731
+ static active() {
1732
+ try {
1733
+ this.watch()?.();
1734
+ }
1735
+ catch (error) {
1736
+ $mol_fail_log(error);
1737
+ }
1738
+ finally {
1739
+ for (const pub of $mol_wire_auto().pub_list) {
1740
+ if (pub instanceof $mol_wire_fiber) {
1741
+ this.track(pub);
1742
+ }
1743
+ }
1744
+ }
1745
+ }
1746
+ }
1747
+ __decorate([
1748
+ $mol_mem
1749
+ ], $mol_wire_log, "watch", null);
1750
+ __decorate([
1751
+ $mol_mem_key
1752
+ ], $mol_wire_log, "track", null);
1753
+ __decorate([
1754
+ $mol_mem
1755
+ ], $mol_wire_log, "active", null);
1756
+ $.$mol_wire_log = $mol_wire_log;
1757
+ })($ || ($ = {}));
1758
+ //mol/wire/log/log.ts
1759
+ ;
1760
+ "use strict";
1761
+ var $;
1762
+ (function ($) {
1763
+ $mol_wire_log.active();
1764
+ })($ || ($ = {}));
1765
+ //mol/wire/atom/atom.test.ts
1766
+ ;
1767
+ "use strict";
1768
+ var $;
1769
+ (function ($) {
1770
+ $mol_test({
1771
+ 'all cases of using maybe'() {
1772
+ $mol_assert_equal($mol_maybe(0)[0], 0);
1773
+ $mol_assert_equal($mol_maybe(false)[0], false);
1643
1774
  $mol_assert_equal($mol_maybe(null)[0], void 0);
1644
1775
  $mol_assert_equal($mol_maybe(void 0)[0], void 0);
1645
1776
  $mol_assert_equal($mol_maybe(void 0).map(v => v.toString())[0], void 0);
@@ -1794,137 +1925,6 @@ var $;
1794
1925
  ;
1795
1926
  "use strict";
1796
1927
  var $;
1797
- (function ($) {
1798
- class $mol_wire_log extends $mol_object2 {
1799
- static watch(task) {
1800
- return task;
1801
- }
1802
- static track(fiber) {
1803
- const prev = $mol_wire_probe(() => this.track(fiber));
1804
- let next;
1805
- try {
1806
- next = fiber.sync();
1807
- }
1808
- finally {
1809
- for (const pub of fiber.pub_list) {
1810
- if (pub instanceof $mol_wire_fiber) {
1811
- this.track(pub);
1812
- }
1813
- }
1814
- }
1815
- if (fiber.host === this)
1816
- return next;
1817
- if ($mol_compare_deep(prev, next)) {
1818
- this.$.$mol_log3_rise({
1819
- message: '💧 Same',
1820
- place: fiber,
1821
- });
1822
- }
1823
- else if (prev !== undefined) {
1824
- this.$.$mol_log3_rise({
1825
- message: '🔥 Next',
1826
- place: fiber,
1827
- prev,
1828
- });
1829
- }
1830
- return next;
1831
- }
1832
- static active() {
1833
- try {
1834
- this.watch()?.();
1835
- }
1836
- catch (error) {
1837
- $mol_fail_log(error);
1838
- }
1839
- finally {
1840
- for (const pub of $mol_wire_auto().pub_list) {
1841
- if (pub instanceof $mol_wire_fiber) {
1842
- this.track(pub);
1843
- }
1844
- }
1845
- }
1846
- }
1847
- }
1848
- __decorate([
1849
- $mol_mem
1850
- ], $mol_wire_log, "watch", null);
1851
- __decorate([
1852
- $mol_mem_key
1853
- ], $mol_wire_log, "track", null);
1854
- __decorate([
1855
- $mol_mem
1856
- ], $mol_wire_log, "active", null);
1857
- $.$mol_wire_log = $mol_wire_log;
1858
- })($ || ($ = {}));
1859
- //mol/wire/log/log.ts
1860
- ;
1861
- "use strict";
1862
- var $;
1863
- (function ($) {
1864
- $mol_test({
1865
- 'Primitives'() {
1866
- $mol_assert_equal($mol_key(null), 'null');
1867
- $mol_assert_equal($mol_key(false), 'false');
1868
- $mol_assert_equal($mol_key(true), 'true');
1869
- $mol_assert_equal($mol_key(0), '0');
1870
- $mol_assert_equal($mol_key(''), '""');
1871
- },
1872
- 'Array & POJO'() {
1873
- $mol_assert_equal($mol_key([null]), '[null]');
1874
- $mol_assert_equal($mol_key({ foo: 0 }), '{"foo":0}');
1875
- $mol_assert_equal($mol_key({ foo: [false] }), '{"foo":[false]}');
1876
- },
1877
- 'Function'() {
1878
- const func = () => { };
1879
- $mol_assert_equal($mol_key(func), $mol_key(func));
1880
- $mol_assert_unique($mol_key(func), $mol_key(() => { }));
1881
- },
1882
- 'Objects'() {
1883
- class User {
1884
- }
1885
- const jin = new User();
1886
- $mol_assert_equal($mol_key(jin), $mol_key(jin));
1887
- $mol_assert_unique($mol_key(jin), $mol_key(new User()));
1888
- },
1889
- 'Elements'() {
1890
- const foo = $mol_jsx("div", null, "bar");
1891
- $mol_assert_equal($mol_key(foo), $mol_key(foo));
1892
- $mol_assert_unique($mol_key(foo), $mol_key($mol_jsx("div", null, "bar")));
1893
- },
1894
- 'Custom JSON representation'() {
1895
- class User {
1896
- name;
1897
- age;
1898
- constructor(name, age) {
1899
- this.name = name;
1900
- this.age = age;
1901
- }
1902
- toJSON() { return { name: this.name }; }
1903
- }
1904
- $mol_assert_equal($mol_key(new User('jin', 18)), '{"name":"jin"}');
1905
- },
1906
- 'Special native classes'() {
1907
- $mol_assert_equal($mol_key(new Date('xyz')), 'null');
1908
- $mol_assert_equal($mol_key(new Date('2001-01-02T03:04:05.678Z')), '"2001-01-02T03:04:05.678Z"');
1909
- $mol_assert_equal($mol_key(/./), '"/./"');
1910
- $mol_assert_equal($mol_key(/\./gimsu), '"/\\\\./gimsu"');
1911
- },
1912
- });
1913
- })($ || ($ = {}));
1914
- //mol/key/key.test.tsx
1915
- ;
1916
- "use strict";
1917
- //mol/type/foot/foot.test.ts
1918
- ;
1919
- "use strict";
1920
- var $;
1921
- (function ($) {
1922
- $mol_wire_log.active();
1923
- })($ || ($ = {}));
1924
- //mol/wire/atom/atom.test.ts
1925
- ;
1926
- "use strict";
1927
- var $;
1928
1928
  (function ($) {
1929
1929
  $mol_test({
1930
1930
  'const returns stored value'() {
@@ -2242,66 +2242,6 @@ var $;
2242
2242
  ;
2243
2243
  "use strict";
2244
2244
  var $;
2245
- (function ($_1) {
2246
- $mol_test({
2247
- 'tree parsing'() {
2248
- $mol_assert_equal($mol_tree.fromString("foo\nbar\n").sub.length, 2);
2249
- $mol_assert_equal($mol_tree.fromString("foo\nbar\n").sub[1].type, "bar");
2250
- $mol_assert_equal($mol_tree.fromString("foo\n\n\n").sub.length, 1);
2251
- $mol_assert_equal($mol_tree.fromString("=foo\n\\bar\n").sub.length, 2);
2252
- $mol_assert_equal($mol_tree.fromString("=foo\n\\bar\n").sub[1].data, "bar");
2253
- $mol_assert_equal($mol_tree.fromString("foo bar \\pol").sub[0].sub[0].sub[0].data, "pol");
2254
- $mol_assert_equal($mol_tree.fromString("foo bar\n\t\\pol\n\t\\men").sub[0].sub[0].sub[1].data, "men");
2255
- $mol_assert_equal($mol_tree.fromString('foo bar \\text\n').toString(), 'foo bar \\text\n');
2256
- },
2257
- 'inserting'() {
2258
- $mol_assert_equal($mol_tree.fromString('a b c d').insert(new $mol_tree, 'a', 'b', 'c').toString(), 'a b \\\n');
2259
- $mol_assert_equal($mol_tree.fromString('a b').insert(new $mol_tree, 'a', 'b', 'c', 'd').toString(), 'a b c \\\n');
2260
- $mol_assert_equal($mol_tree.fromString('a b c d').insert(new $mol_tree, 0, 0, 0).toString(), 'a b \\\n');
2261
- $mol_assert_equal($mol_tree.fromString('a b').insert(new $mol_tree, 0, 0, 0, 0).toString(), 'a b \\\n\t\\\n');
2262
- $mol_assert_equal($mol_tree.fromString('a b c d').insert(new $mol_tree, null, null, null).toString(), 'a b \\\n');
2263
- $mol_assert_equal($mol_tree.fromString('a b').insert(new $mol_tree, null, null, null, null).toString(), 'a b \\\n\t\\\n');
2264
- },
2265
- 'fromJSON'() {
2266
- $mol_assert_equal($mol_tree.fromJSON([]).toString(), '/\n');
2267
- $mol_assert_equal($mol_tree.fromJSON([false, true]).toString(), '/\n\tfalse\n\ttrue\n');
2268
- $mol_assert_equal($mol_tree.fromJSON([0, 1, 2.3]).toString(), '/\n\t0\n\t1\n\t2.3\n');
2269
- $mol_assert_equal($mol_tree.fromJSON(['', 'foo', 'bar\nbaz']).toString(), '/\n\t\\\n\t\\foo\n\t\\\n\t\t\\bar\n\t\t\\baz\n');
2270
- $mol_assert_equal($mol_tree.fromJSON({ 'foo': false, 'bar\nbaz': 'lol' }).toString(), '*\n\tfoo false\n\t\\\n\t\t\\bar\n\t\t\\baz\n\t\t\\lol\n');
2271
- },
2272
- 'toJSON'() {
2273
- $mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n').sub[0]), '[]');
2274
- $mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n\tfalse\n\ttrue\n').sub[0]), '[false,true]');
2275
- $mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n\t0\n\t1\n\t2.3\n').sub[0]), '[0,1,2.3]');
2276
- $mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n\t\\\n\t\\foo\n\t\\\n\t\t\\bar\n\t\t\\baz\n').sub[0]), '["","foo","bar\\nbaz"]');
2277
- $mol_assert_equal(JSON.stringify($mol_tree.fromString('*\n\tfoo false\n\t\\\n\t\t\\bar\n\t\t\\baz\n\t\t\\lol\n').sub[0]), '{"foo":false,"bar\\nbaz":"lol"}');
2278
- },
2279
- 'hack'() {
2280
- const res = $mol_tree.fromString(`foo bar xxx`).hack({
2281
- '': (tree, context) => [tree.hack(context)],
2282
- 'bar': (tree, context) => [tree.hack(context).clone({ type: '777' })],
2283
- });
2284
- $mol_assert_equal(res.toString(), new $mol_tree({ type: 'foo 777 xxx' }).toString());
2285
- },
2286
- 'errors handling'($) {
2287
- const errors = [];
2288
- class Tree extends $mol_tree {
2289
- static $ = $.$mol_ambient({
2290
- $mol_fail: error => errors.push(error.message)
2291
- });
2292
- }
2293
- Tree.fromString(`
2294
- \t \tfoo
2295
- bar \\data
2296
- `, 'test');
2297
- $mol_assert_like(errors, ['Syntax error at test:2\n \tfoo']);
2298
- },
2299
- });
2300
- })($ || ($ = {}));
2301
- //mol/tree/tree.test.ts
2302
- ;
2303
- "use strict";
2304
- var $;
2305
2245
  (function ($) {
2306
2246
  $.$mol_tree_convert = Symbol('$mol_tree_convert');
2307
2247
  class $mol_tree extends $mol_object2 {
@@ -2632,6 +2572,66 @@ var $;
2632
2572
  ;
2633
2573
  "use strict";
2634
2574
  var $;
2575
+ (function ($_1) {
2576
+ $mol_test({
2577
+ 'tree parsing'() {
2578
+ $mol_assert_equal($mol_tree.fromString("foo\nbar\n").sub.length, 2);
2579
+ $mol_assert_equal($mol_tree.fromString("foo\nbar\n").sub[1].type, "bar");
2580
+ $mol_assert_equal($mol_tree.fromString("foo\n\n\n").sub.length, 1);
2581
+ $mol_assert_equal($mol_tree.fromString("=foo\n\\bar\n").sub.length, 2);
2582
+ $mol_assert_equal($mol_tree.fromString("=foo\n\\bar\n").sub[1].data, "bar");
2583
+ $mol_assert_equal($mol_tree.fromString("foo bar \\pol").sub[0].sub[0].sub[0].data, "pol");
2584
+ $mol_assert_equal($mol_tree.fromString("foo bar\n\t\\pol\n\t\\men").sub[0].sub[0].sub[1].data, "men");
2585
+ $mol_assert_equal($mol_tree.fromString('foo bar \\text\n').toString(), 'foo bar \\text\n');
2586
+ },
2587
+ 'inserting'() {
2588
+ $mol_assert_equal($mol_tree.fromString('a b c d').insert(new $mol_tree, 'a', 'b', 'c').toString(), 'a b \\\n');
2589
+ $mol_assert_equal($mol_tree.fromString('a b').insert(new $mol_tree, 'a', 'b', 'c', 'd').toString(), 'a b c \\\n');
2590
+ $mol_assert_equal($mol_tree.fromString('a b c d').insert(new $mol_tree, 0, 0, 0).toString(), 'a b \\\n');
2591
+ $mol_assert_equal($mol_tree.fromString('a b').insert(new $mol_tree, 0, 0, 0, 0).toString(), 'a b \\\n\t\\\n');
2592
+ $mol_assert_equal($mol_tree.fromString('a b c d').insert(new $mol_tree, null, null, null).toString(), 'a b \\\n');
2593
+ $mol_assert_equal($mol_tree.fromString('a b').insert(new $mol_tree, null, null, null, null).toString(), 'a b \\\n\t\\\n');
2594
+ },
2595
+ 'fromJSON'() {
2596
+ $mol_assert_equal($mol_tree.fromJSON([]).toString(), '/\n');
2597
+ $mol_assert_equal($mol_tree.fromJSON([false, true]).toString(), '/\n\tfalse\n\ttrue\n');
2598
+ $mol_assert_equal($mol_tree.fromJSON([0, 1, 2.3]).toString(), '/\n\t0\n\t1\n\t2.3\n');
2599
+ $mol_assert_equal($mol_tree.fromJSON(['', 'foo', 'bar\nbaz']).toString(), '/\n\t\\\n\t\\foo\n\t\\\n\t\t\\bar\n\t\t\\baz\n');
2600
+ $mol_assert_equal($mol_tree.fromJSON({ 'foo': false, 'bar\nbaz': 'lol' }).toString(), '*\n\tfoo false\n\t\\\n\t\t\\bar\n\t\t\\baz\n\t\t\\lol\n');
2601
+ },
2602
+ 'toJSON'() {
2603
+ $mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n').sub[0]), '[]');
2604
+ $mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n\tfalse\n\ttrue\n').sub[0]), '[false,true]');
2605
+ $mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n\t0\n\t1\n\t2.3\n').sub[0]), '[0,1,2.3]');
2606
+ $mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n\t\\\n\t\\foo\n\t\\\n\t\t\\bar\n\t\t\\baz\n').sub[0]), '["","foo","bar\\nbaz"]');
2607
+ $mol_assert_equal(JSON.stringify($mol_tree.fromString('*\n\tfoo false\n\t\\\n\t\t\\bar\n\t\t\\baz\n\t\t\\lol\n').sub[0]), '{"foo":false,"bar\\nbaz":"lol"}');
2608
+ },
2609
+ 'hack'() {
2610
+ const res = $mol_tree.fromString(`foo bar xxx`).hack({
2611
+ '': (tree, context) => [tree.hack(context)],
2612
+ 'bar': (tree, context) => [tree.hack(context).clone({ type: '777' })],
2613
+ });
2614
+ $mol_assert_equal(res.toString(), new $mol_tree({ type: 'foo 777 xxx' }).toString());
2615
+ },
2616
+ 'errors handling'($) {
2617
+ const errors = [];
2618
+ class Tree extends $mol_tree {
2619
+ static $ = $.$mol_ambient({
2620
+ $mol_fail: error => errors.push(error.message)
2621
+ });
2622
+ }
2623
+ Tree.fromString(`
2624
+ \t \tfoo
2625
+ bar \\data
2626
+ `, 'test');
2627
+ $mol_assert_like(errors, ['Syntax error at test:2\n \tfoo']);
2628
+ },
2629
+ });
2630
+ })($ || ($ = {}));
2631
+ //mol/tree/tree.test.ts
2632
+ ;
2633
+ "use strict";
2634
+ var $;
2635
2635
  (function ($) {
2636
2636
  class $mol_state_local extends $mol_object {
2637
2637
  static 'native()';
@@ -2733,6 +2733,20 @@ var $;
2733
2733
  ;
2734
2734
  "use strict";
2735
2735
  var $;
2736
+ (function ($) {
2737
+ const decoders = {};
2738
+ function $mol_charset_decode(buffer, encoding = 'utf8') {
2739
+ let decoder = decoders[encoding];
2740
+ if (!decoder)
2741
+ decoder = decoders[encoding] = new TextDecoder(encoding);
2742
+ return decoder.decode(buffer);
2743
+ }
2744
+ $.$mol_charset_decode = $mol_charset_decode;
2745
+ })($ || ($ = {}));
2746
+ //mol/charset/decode/decode.ts
2747
+ ;
2748
+ "use strict";
2749
+ var $;
2736
2750
  (function ($) {
2737
2751
  $mol_test({
2738
2752
  'decode utf8 string'() {
@@ -2750,20 +2764,6 @@ var $;
2750
2764
  //mol/charset/decode/decode.test.ts
2751
2765
  ;
2752
2766
  "use strict";
2753
- var $;
2754
- (function ($) {
2755
- const decoders = {};
2756
- function $mol_charset_decode(buffer, encoding = 'utf8') {
2757
- let decoder = decoders[encoding];
2758
- if (!decoder)
2759
- decoder = decoders[encoding] = new TextDecoder(encoding);
2760
- return decoder.decode(buffer);
2761
- }
2762
- $.$mol_charset_decode = $mol_charset_decode;
2763
- })($ || ($ = {}));
2764
- //mol/charset/decode/decode.ts
2765
- ;
2766
- "use strict";
2767
2767
  //node/node.ts
2768
2768
  ;
2769
2769
  "use strict";
@@ -2772,6 +2772,18 @@ var $node = $node || {};
2772
2772
  ;
2773
2773
  "use strict";
2774
2774
  var $;
2775
+ (function ($) {
2776
+ const TextEncoder = globalThis.TextEncoder ?? $node.util.TextEncoder;
2777
+ const encoder = new TextEncoder();
2778
+ function $mol_charset_encode(value) {
2779
+ return encoder.encode(value);
2780
+ }
2781
+ $.$mol_charset_encode = $mol_charset_encode;
2782
+ })($ || ($ = {}));
2783
+ //mol/charset/encode/encode.ts
2784
+ ;
2785
+ "use strict";
2786
+ var $;
2775
2787
  (function ($) {
2776
2788
  $mol_test({
2777
2789
  'encode utf8 string'() {
@@ -2785,18 +2797,6 @@ var $;
2785
2797
  ;
2786
2798
  "use strict";
2787
2799
  var $;
2788
- (function ($) {
2789
- const TextEncoder = globalThis.TextEncoder ?? $node.util.TextEncoder;
2790
- const encoder = new TextEncoder();
2791
- function $mol_charset_encode(value) {
2792
- return encoder.encode(value);
2793
- }
2794
- $.$mol_charset_encode = $mol_charset_encode;
2795
- })($ || ($ = {}));
2796
- //mol/charset/encode/encode.ts
2797
- ;
2798
- "use strict";
2799
- var $;
2800
2800
  (function ($) {
2801
2801
  class $mol_file_not_found extends Error {
2802
2802
  }
@@ -3168,27 +3168,6 @@ var $;
3168
3168
  ;
3169
3169
  "use strict";
3170
3170
  var $;
3171
- (function ($_1) {
3172
- $mol_test_mocks.push($ => {
3173
- class $mol_locale_mock extends $mol_locale {
3174
- lang(next = 'en') { return next; }
3175
- static source(lang) {
3176
- return {};
3177
- }
3178
- }
3179
- __decorate([
3180
- $mol_mem
3181
- ], $mol_locale_mock.prototype, "lang", null);
3182
- __decorate([
3183
- $mol_mem_key
3184
- ], $mol_locale_mock, "source", null);
3185
- $.$mol_locale = $mol_locale_mock;
3186
- });
3187
- })($ || ($ = {}));
3188
- //mol/locale/locale.test.ts
3189
- ;
3190
- "use strict";
3191
- var $;
3192
3171
  (function ($) {
3193
3172
  class $mol_locale extends $mol_object {
3194
3173
  static lang_default() {
@@ -3253,6 +3232,27 @@ var $;
3253
3232
  ;
3254
3233
  "use strict";
3255
3234
  var $;
3235
+ (function ($_1) {
3236
+ $mol_test_mocks.push($ => {
3237
+ class $mol_locale_mock extends $mol_locale {
3238
+ lang(next = 'en') { return next; }
3239
+ static source(lang) {
3240
+ return {};
3241
+ }
3242
+ }
3243
+ __decorate([
3244
+ $mol_mem
3245
+ ], $mol_locale_mock.prototype, "lang", null);
3246
+ __decorate([
3247
+ $mol_mem_key
3248
+ ], $mol_locale_mock, "source", null);
3249
+ $.$mol_locale = $mol_locale_mock;
3250
+ });
3251
+ })($ || ($ = {}));
3252
+ //mol/locale/locale.test.ts
3253
+ ;
3254
+ "use strict";
3255
+ var $;
3256
3256
  (function ($) {
3257
3257
  function $mol_view_tree_trim_remarks(def) {
3258
3258
  return def.transform(([node], sub) => (node.type === '-') ? null : node.clone({ sub: sub() }));