mol_tree2 1.0.214 → 1.0.215

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.test.js CHANGED
@@ -1,4 +1,12 @@
1
1
  "use strict";
2
+ "use strict";
3
+ Error.stackTraceLimit = 50;
4
+ var $;
5
+ (function ($) {
6
+ })($ || ($ = {}));
7
+ module.exports = $;
8
+ //mam.ts
9
+ ;
2
10
  "use strict"
3
11
 
4
12
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
@@ -11,14 +19,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
11
19
  var $ = ( typeof module === 'object' ) ? ( module['export'+'s'] = globalThis ) : globalThis
12
20
  $.$$ = $
13
21
 
14
- ;
15
- "use strict";
16
- Error.stackTraceLimit = 50;
17
- var $;
18
- (function ($) {
19
- })($ || ($ = {}));
20
- module.exports = $;
21
- //mam.ts
22
22
  ;
23
23
  "use strict";
24
24
  var $;
@@ -1311,16 +1311,6 @@ var $;
1311
1311
  ;
1312
1312
  "use strict";
1313
1313
  var $;
1314
- (function ($) {
1315
- function $mol_test_complete() {
1316
- process.exit(0);
1317
- }
1318
- $.$mol_test_complete = $mol_test_complete;
1319
- })($ || ($ = {}));
1320
- //mol/test/test.node.test.ts
1321
- ;
1322
- "use strict";
1323
- var $;
1324
1314
  (function ($_1) {
1325
1315
  function $mol_test(set) {
1326
1316
  for (let name in set) {
@@ -1408,6 +1398,16 @@ var $;
1408
1398
  ;
1409
1399
  "use strict";
1410
1400
  var $;
1401
+ (function ($) {
1402
+ function $mol_test_complete() {
1403
+ process.exit(0);
1404
+ }
1405
+ $.$mol_test_complete = $mol_test_complete;
1406
+ })($ || ($ = {}));
1407
+ //mol/test/test.node.test.ts
1408
+ ;
1409
+ "use strict";
1410
+ var $;
1411
1411
  (function ($) {
1412
1412
  })($ || ($ = {}));
1413
1413
  //mol/dom/context/context.ts
@@ -1676,112 +1676,22 @@ var $;
1676
1676
  //mol/type/error/error.ts
1677
1677
  ;
1678
1678
  "use strict";
1679
- //mol/type/assert/assert.test.ts
1680
- ;
1681
- "use strict";
1682
1679
  //mol/type/assert/assert.ts
1683
1680
  ;
1684
1681
  "use strict";
1685
- //mol/type/equals/equals.test.ts
1682
+ //mol/type/assert/assert.test.ts
1686
1683
  ;
1687
1684
  "use strict";
1688
1685
  //mol/type/equals/equals.ts
1689
1686
  ;
1690
1687
  "use strict";
1691
- //mol/type/partial/deep/deep.test.ts
1688
+ //mol/type/equals/equals.test.ts
1692
1689
  ;
1693
1690
  "use strict";
1694
1691
  //mol/type/partial/deep/deep.ts
1695
1692
  ;
1696
1693
  "use strict";
1697
- var $;
1698
- (function ($) {
1699
- $mol_test({
1700
- 'Make empty div'() {
1701
- $mol_assert_equal(($mol_jsx("div", null)).outerHTML, '<div></div>');
1702
- },
1703
- 'Define native field'() {
1704
- const dom = $mol_jsx("input", { value: '123' });
1705
- $mol_assert_equal(dom.outerHTML, '<input value="123">');
1706
- $mol_assert_equal(dom.value, '123');
1707
- },
1708
- 'Define classes'() {
1709
- const dom = $mol_jsx("div", { class: 'foo bar' });
1710
- $mol_assert_equal(dom.outerHTML, '<div class="foo bar"></div>');
1711
- },
1712
- 'Define styles'() {
1713
- const dom = $mol_jsx("div", { style: { color: 'red' } });
1714
- $mol_assert_equal(dom.outerHTML, '<div style="color: red;"></div>');
1715
- },
1716
- 'Define dataset'() {
1717
- const dom = $mol_jsx("div", { dataset: { foo: 'bar' } });
1718
- $mol_assert_equal(dom.outerHTML, '<div data-foo="bar"></div>');
1719
- },
1720
- 'Define attributes'() {
1721
- const dom = $mol_jsx("div", { lang: "ru", hidden: true });
1722
- $mol_assert_equal(dom.outerHTML, '<div lang="ru" hidden=""></div>');
1723
- },
1724
- 'Define child nodes'() {
1725
- const dom = $mol_jsx("div", null,
1726
- "hello",
1727
- $mol_jsx("strong", null, "world"),
1728
- "!");
1729
- $mol_assert_equal(dom.outerHTML, '<div>hello<strong>world</strong>!</div>');
1730
- },
1731
- 'Function as component'() {
1732
- const Button = (props, target) => {
1733
- return $mol_jsx("button", { title: props.hint }, target());
1734
- };
1735
- const dom = $mol_jsx(Button, { id: "foo", hint: "click me" }, () => 'hey!');
1736
- $mol_assert_equal(dom.outerHTML, '<button id="foo" title="click me" class="Button">hey!</button>');
1737
- },
1738
- 'Nested guid generation'() {
1739
- const Foo = () => {
1740
- return $mol_jsx("div", null,
1741
- $mol_jsx(Bar, { id: "bar" },
1742
- $mol_jsx("img", { id: "icon" })));
1743
- };
1744
- const Bar = (props, icon) => {
1745
- return $mol_jsx("span", null,
1746
- icon,
1747
- $mol_jsx("i", { id: "label" }));
1748
- };
1749
- const dom = $mol_jsx(Foo, { id: "foo" });
1750
- $mol_assert_equal(dom.outerHTML, '<div id="foo" class="Foo"><span id="foo/bar" class="Foo_bar Bar"><img id="foo/icon" class="Foo_icon"><i id="foo/bar/label" class="Foo_bar_label Bar_label"></i></span></div>');
1751
- },
1752
- 'Fail on non unique ids'() {
1753
- const App = () => {
1754
- return $mol_jsx("div", null,
1755
- $mol_jsx("span", { id: "bar" }),
1756
- $mol_jsx("span", { id: "bar" }));
1757
- };
1758
- $mol_assert_fail(() => $mol_jsx(App, { id: "foo" }), 'JSX already has tag with id "foo/bar"');
1759
- },
1760
- 'Owner based guid generationn'() {
1761
- const Foo = () => {
1762
- return $mol_jsx("div", null,
1763
- $mol_jsx(Bar, { id: "middle", icon: () => $mol_jsx("img", { id: "icon" }) }));
1764
- };
1765
- const Bar = (props) => {
1766
- return $mol_jsx("span", null, props.icon());
1767
- };
1768
- const dom = $mol_jsx(Foo, { id: "app" });
1769
- $mol_assert_equal(dom.outerHTML, '<div id="app" class="Foo"><span id="app/middle" class="Foo_middle Bar"><img id="app/icon" class="Foo_icon"></span></div>');
1770
- },
1771
- 'Fail on same ids from different caller'() {
1772
- const Foo = () => {
1773
- return $mol_jsx("div", null,
1774
- $mol_jsx("img", { id: "icon" }),
1775
- $mol_jsx(Bar, { id: "bar", icon: () => $mol_jsx("img", { id: "icon" }) }));
1776
- };
1777
- const Bar = (props) => {
1778
- return $mol_jsx("span", null, props.icon());
1779
- };
1780
- $mol_assert_fail(() => $mol_jsx(Foo, { id: "foo" }), 'JSX already has tag with id "foo/icon"');
1781
- },
1782
- });
1783
- })($ || ($ = {}));
1784
- //mol/jsx/jsx.test.tsx
1694
+ //mol/type/partial/deep/deep.test.ts
1785
1695
  ;
1786
1696
  "use strict";
1787
1697
  var $;
@@ -1908,97 +1818,91 @@ var $;
1908
1818
  var $;
1909
1819
  (function ($) {
1910
1820
  $mol_test({
1911
- 'nulls & undefineds'() {
1912
- $mol_assert_ok($mol_compare_deep(null, null));
1913
- $mol_assert_ok($mol_compare_deep(undefined, undefined));
1914
- $mol_assert_not($mol_compare_deep(undefined, null));
1915
- $mol_assert_not($mol_compare_deep({}, null));
1916
- },
1917
- 'number'() {
1918
- $mol_assert_ok($mol_compare_deep(1, 1));
1919
- $mol_assert_ok($mol_compare_deep(Number.NaN, Number.NaN));
1920
- $mol_assert_not($mol_compare_deep(1, 2));
1921
- $mol_assert_ok($mol_compare_deep(Object(1), Object(1)));
1922
- $mol_assert_not($mol_compare_deep(Object(1), Object(2)));
1821
+ 'Make empty div'() {
1822
+ $mol_assert_equal(($mol_jsx("div", null)).outerHTML, '<div></div>');
1923
1823
  },
1924
- 'POJO'() {
1925
- $mol_assert_ok($mol_compare_deep({}, {}));
1926
- $mol_assert_not($mol_compare_deep({ a: 1 }, { b: 2 }));
1927
- $mol_assert_not($mol_compare_deep({ a: 1 }, { a: 2 }));
1928
- $mol_assert_not($mol_compare_deep({}, { a: undefined }));
1929
- $mol_assert_ok($mol_compare_deep({ a: 1, b: 2 }, { b: 2, a: 1 }));
1930
- $mol_assert_ok($mol_compare_deep({ a: { b: 1 } }, { a: { b: 1 } }));
1824
+ 'Define native field'() {
1825
+ const dom = $mol_jsx("input", { value: '123' });
1826
+ $mol_assert_equal(dom.outerHTML, '<input value="123">');
1827
+ $mol_assert_equal(dom.value, '123');
1931
1828
  },
1932
- 'Array'() {
1933
- $mol_assert_ok($mol_compare_deep([], []));
1934
- $mol_assert_ok($mol_compare_deep([1, [2]], [1, [2]]));
1935
- $mol_assert_not($mol_compare_deep([1, 2], [1, 3]));
1936
- $mol_assert_not($mol_compare_deep([1, 2,], [1, 3, undefined]));
1829
+ 'Define classes'() {
1830
+ const dom = $mol_jsx("div", { class: 'foo bar' });
1831
+ $mol_assert_equal(dom.outerHTML, '<div class="foo bar"></div>');
1937
1832
  },
1938
- 'Non POJO are different'() {
1939
- class Thing extends Object {
1940
- }
1941
- $mol_assert_not($mol_compare_deep(new Thing, new Thing));
1942
- $mol_assert_not($mol_compare_deep(() => 1, () => 1));
1943
- $mol_assert_not($mol_compare_deep(new RangeError('Test error'), new RangeError('Test error')));
1833
+ 'Define styles'() {
1834
+ const dom = $mol_jsx("div", { style: { color: 'red' } });
1835
+ $mol_assert_equal(dom.outerHTML, '<div style="color: red;"></div>');
1944
1836
  },
1945
- 'same POJOs with cyclic reference'() {
1946
- const a = { foo: {} };
1947
- a['self'] = a;
1948
- const b = { foo: {} };
1949
- b['self'] = b;
1950
- $mol_assert_ok($mol_compare_deep(a, b));
1837
+ 'Define dataset'() {
1838
+ const dom = $mol_jsx("div", { dataset: { foo: 'bar' } });
1839
+ $mol_assert_equal(dom.outerHTML, '<div data-foo="bar"></div>');
1951
1840
  },
1952
- 'Date'() {
1953
- $mol_assert_ok($mol_compare_deep(new Date(12345), new Date(12345)));
1954
- $mol_assert_not($mol_compare_deep(new Date(12345), new Date(12346)));
1841
+ 'Define attributes'() {
1842
+ const dom = $mol_jsx("div", { lang: "ru", hidden: true });
1843
+ $mol_assert_equal(dom.outerHTML, '<div lang="ru" hidden=""></div>');
1955
1844
  },
1956
- 'RegExp'() {
1957
- $mol_assert_ok($mol_compare_deep(/\x22/mig, /\x22/mig));
1958
- $mol_assert_not($mol_compare_deep(/\x22/mig, /\x21/mig));
1959
- $mol_assert_not($mol_compare_deep(/\x22/mig, /\x22/mg));
1845
+ 'Define child nodes'() {
1846
+ const dom = $mol_jsx("div", null,
1847
+ "hello",
1848
+ $mol_jsx("strong", null, "world"),
1849
+ "!");
1850
+ $mol_assert_equal(dom.outerHTML, '<div>hello<strong>world</strong>!</div>');
1960
1851
  },
1961
- 'Error'() {
1962
- $mol_assert_not($mol_compare_deep(new Error('xxx'), new Error('xxx')));
1963
- const fail = (message) => new Error(message);
1964
- $mol_assert_ok($mol_compare_deep(...['xxx', 'xxx'].map(msg => new Error(msg))));
1965
- $mol_assert_not($mol_compare_deep(...['xxx', 'yyy'].map(msg => new Error(msg))));
1852
+ 'Function as component'() {
1853
+ const Button = (props, target) => {
1854
+ return $mol_jsx("button", { title: props.hint }, target());
1855
+ };
1856
+ const dom = $mol_jsx(Button, { id: "foo", hint: "click me" }, () => 'hey!');
1857
+ $mol_assert_equal(dom.outerHTML, '<button id="foo" title="click me" class="Button">hey!</button>');
1966
1858
  },
1967
- 'Map'() {
1968
- $mol_assert_ok($mol_compare_deep(new Map, new Map));
1969
- $mol_assert_ok($mol_compare_deep(new Map([[1, [2]]]), new Map([[1, [2]]])));
1970
- $mol_assert_ok($mol_compare_deep(new Map([[[1], 2]]), new Map([[[1], 2]])));
1971
- $mol_assert_not($mol_compare_deep(new Map([[1, 2]]), new Map([[1, 3]])));
1972
- $mol_assert_not($mol_compare_deep(new Map([[[1], 2]]), new Map([[[3], 2]])));
1859
+ 'Nested guid generation'() {
1860
+ const Foo = () => {
1861
+ return $mol_jsx("div", null,
1862
+ $mol_jsx(Bar, { id: "bar" },
1863
+ $mol_jsx("img", { id: "icon" })));
1864
+ };
1865
+ const Bar = (props, icon) => {
1866
+ return $mol_jsx("span", null,
1867
+ icon,
1868
+ $mol_jsx("i", { id: "label" }));
1869
+ };
1870
+ const dom = $mol_jsx(Foo, { id: "foo" });
1871
+ $mol_assert_equal(dom.outerHTML, '<div id="foo" class="Foo"><span id="foo/bar" class="Foo_bar Bar"><img id="foo/icon" class="Foo_icon"><i id="foo/bar/label" class="Foo_bar_label Bar_label"></i></span></div>');
1973
1872
  },
1974
- 'Set'() {
1975
- $mol_assert_ok($mol_compare_deep(new Set, new Set));
1976
- $mol_assert_ok($mol_compare_deep(new Set([1, [2]]), new Set([1, [2]])));
1977
- $mol_assert_not($mol_compare_deep(new Set([1]), new Set([2])));
1873
+ 'Fail on non unique ids'() {
1874
+ const App = () => {
1875
+ return $mol_jsx("div", null,
1876
+ $mol_jsx("span", { id: "bar" }),
1877
+ $mol_jsx("span", { id: "bar" }));
1878
+ };
1879
+ $mol_assert_fail(() => $mol_jsx(App, { id: "foo" }), 'JSX already has tag with id "foo/bar"');
1978
1880
  },
1979
- 'Uint8Array'() {
1980
- $mol_assert_ok($mol_compare_deep(new Uint8Array, new Uint8Array));
1981
- $mol_assert_ok($mol_compare_deep(new Uint8Array([0]), new Uint8Array([0])));
1982
- $mol_assert_not($mol_compare_deep(new Uint8Array([0]), new Uint8Array([1])));
1881
+ 'Owner based guid generationn'() {
1882
+ const Foo = () => {
1883
+ return $mol_jsx("div", null,
1884
+ $mol_jsx(Bar, { id: "middle", icon: () => $mol_jsx("img", { id: "icon" }) }));
1885
+ };
1886
+ const Bar = (props) => {
1887
+ return $mol_jsx("span", null, props.icon());
1888
+ };
1889
+ const dom = $mol_jsx(Foo, { id: "app" });
1890
+ $mol_assert_equal(dom.outerHTML, '<div id="app" class="Foo"><span id="app/middle" class="Foo_middle Bar"><img id="app/icon" class="Foo_icon"></span></div>');
1983
1891
  },
1984
- 'Custom comparator'() {
1985
- class User {
1986
- name;
1987
- rand;
1988
- constructor(name, rand = Math.random()) {
1989
- this.name = name;
1990
- this.rand = rand;
1991
- }
1992
- [Symbol.toPrimitive](mode) {
1993
- return this.name;
1994
- }
1995
- }
1996
- $mol_assert_ok($mol_compare_deep(new User('Jin'), new User('Jin')));
1997
- $mol_assert_not($mol_compare_deep(new User('Jin'), new User('John')));
1892
+ 'Fail on same ids from different caller'() {
1893
+ const Foo = () => {
1894
+ return $mol_jsx("div", null,
1895
+ $mol_jsx("img", { id: "icon" }),
1896
+ $mol_jsx(Bar, { id: "bar", icon: () => $mol_jsx("img", { id: "icon" }) }));
1897
+ };
1898
+ const Bar = (props) => {
1899
+ return $mol_jsx("span", null, props.icon());
1900
+ };
1901
+ $mol_assert_fail(() => $mol_jsx(Foo, { id: "foo" }), 'JSX already has tag with id "foo/icon"');
1998
1902
  },
1999
1903
  });
2000
1904
  })($ || ($ = {}));
2001
- //mol/compare/deep/deep.test.tsx
1905
+ //mol/jsx/jsx.test.tsx
2002
1906
  ;
2003
1907
  "use strict";
2004
1908
  var $;
@@ -2127,46 +2031,110 @@ var $;
2127
2031
  ;
2128
2032
  "use strict";
2129
2033
  var $;
2130
- (function ($) {
2131
- function $mol_dom_serialize(node) {
2132
- const serializer = new $mol_dom_context.XMLSerializer;
2133
- return serializer.serializeToString(node);
2134
- }
2135
- $.$mol_dom_serialize = $mol_dom_serialize;
2136
- })($ || ($ = {}));
2137
- //mol/dom/serialize/serialize.ts
2138
- ;
2139
- "use strict";
2140
- var $;
2141
2034
  (function ($) {
2142
2035
  $mol_test({
2143
- 'must be false'() {
2144
- $mol_assert_not(0);
2036
+ 'nulls & undefineds'() {
2037
+ $mol_assert_ok($mol_compare_deep(null, null));
2038
+ $mol_assert_ok($mol_compare_deep(undefined, undefined));
2039
+ $mol_assert_not($mol_compare_deep(undefined, null));
2040
+ $mol_assert_not($mol_compare_deep({}, null));
2145
2041
  },
2146
- 'must be true'() {
2147
- $mol_assert_ok(1);
2042
+ 'number'() {
2043
+ $mol_assert_ok($mol_compare_deep(1, 1));
2044
+ $mol_assert_ok($mol_compare_deep(Number.NaN, Number.NaN));
2045
+ $mol_assert_not($mol_compare_deep(1, 2));
2046
+ $mol_assert_ok($mol_compare_deep(Object(1), Object(1)));
2047
+ $mol_assert_not($mol_compare_deep(Object(1), Object(2)));
2148
2048
  },
2149
- 'two must be equal'() {
2150
- $mol_assert_equal(2, 2);
2049
+ 'POJO'() {
2050
+ $mol_assert_ok($mol_compare_deep({}, {}));
2051
+ $mol_assert_not($mol_compare_deep({ a: 1 }, { b: 2 }));
2052
+ $mol_assert_not($mol_compare_deep({ a: 1 }, { a: 2 }));
2053
+ $mol_assert_not($mol_compare_deep({}, { a: undefined }));
2054
+ $mol_assert_ok($mol_compare_deep({ a: 1, b: 2 }, { b: 2, a: 1 }));
2055
+ $mol_assert_ok($mol_compare_deep({ a: { b: 1 } }, { a: { b: 1 } }));
2151
2056
  },
2152
- 'three must be equal'() {
2153
- $mol_assert_equal(2, 2, 2);
2057
+ 'Array'() {
2058
+ $mol_assert_ok($mol_compare_deep([], []));
2059
+ $mol_assert_ok($mol_compare_deep([1, [2]], [1, [2]]));
2060
+ $mol_assert_not($mol_compare_deep([1, 2], [1, 3]));
2061
+ $mol_assert_not($mol_compare_deep([1, 2,], [1, 3, undefined]));
2154
2062
  },
2155
- 'two must be unique'() {
2156
- $mol_assert_unique([3], [3]);
2063
+ 'Non POJO are different'() {
2064
+ class Thing extends Object {
2065
+ }
2066
+ $mol_assert_not($mol_compare_deep(new Thing, new Thing));
2067
+ $mol_assert_not($mol_compare_deep(() => 1, () => 1));
2068
+ $mol_assert_not($mol_compare_deep(new RangeError('Test error'), new RangeError('Test error')));
2157
2069
  },
2158
- 'three must be unique'() {
2159
- $mol_assert_unique([3], [3], [3]);
2070
+ 'same POJOs with cyclic reference'() {
2071
+ const a = { foo: {} };
2072
+ a['self'] = a;
2073
+ const b = { foo: {} };
2074
+ b['self'] = b;
2075
+ $mol_assert_ok($mol_compare_deep(a, b));
2160
2076
  },
2161
- 'two must be alike'() {
2162
- $mol_assert_like([3], [3]);
2077
+ 'Date'() {
2078
+ $mol_assert_ok($mol_compare_deep(new Date(12345), new Date(12345)));
2079
+ $mol_assert_not($mol_compare_deep(new Date(12345), new Date(12346)));
2163
2080
  },
2164
- 'three must be alike'() {
2165
- $mol_assert_like([3], [3], [3]);
2081
+ 'RegExp'() {
2082
+ $mol_assert_ok($mol_compare_deep(/\x22/mig, /\x22/mig));
2083
+ $mol_assert_not($mol_compare_deep(/\x22/mig, /\x21/mig));
2084
+ $mol_assert_not($mol_compare_deep(/\x22/mig, /\x22/mg));
2085
+ },
2086
+ 'Error'() {
2087
+ $mol_assert_not($mol_compare_deep(new Error('xxx'), new Error('xxx')));
2088
+ const fail = (message) => new Error(message);
2089
+ $mol_assert_ok($mol_compare_deep(...['xxx', 'xxx'].map(msg => new Error(msg))));
2090
+ $mol_assert_not($mol_compare_deep(...['xxx', 'yyy'].map(msg => new Error(msg))));
2091
+ },
2092
+ 'Map'() {
2093
+ $mol_assert_ok($mol_compare_deep(new Map, new Map));
2094
+ $mol_assert_ok($mol_compare_deep(new Map([[1, [2]]]), new Map([[1, [2]]])));
2095
+ $mol_assert_ok($mol_compare_deep(new Map([[[1], 2]]), new Map([[[1], 2]])));
2096
+ $mol_assert_not($mol_compare_deep(new Map([[1, 2]]), new Map([[1, 3]])));
2097
+ $mol_assert_not($mol_compare_deep(new Map([[[1], 2]]), new Map([[[3], 2]])));
2098
+ },
2099
+ 'Set'() {
2100
+ $mol_assert_ok($mol_compare_deep(new Set, new Set));
2101
+ $mol_assert_ok($mol_compare_deep(new Set([1, [2]]), new Set([1, [2]])));
2102
+ $mol_assert_not($mol_compare_deep(new Set([1]), new Set([2])));
2103
+ },
2104
+ 'Uint8Array'() {
2105
+ $mol_assert_ok($mol_compare_deep(new Uint8Array, new Uint8Array));
2106
+ $mol_assert_ok($mol_compare_deep(new Uint8Array([0]), new Uint8Array([0])));
2107
+ $mol_assert_not($mol_compare_deep(new Uint8Array([0]), new Uint8Array([1])));
2108
+ },
2109
+ 'Custom comparator'() {
2110
+ class User {
2111
+ name;
2112
+ rand;
2113
+ constructor(name, rand = Math.random()) {
2114
+ this.name = name;
2115
+ this.rand = rand;
2116
+ }
2117
+ [Symbol.toPrimitive](mode) {
2118
+ return this.name;
2119
+ }
2120
+ }
2121
+ $mol_assert_ok($mol_compare_deep(new User('Jin'), new User('Jin')));
2122
+ $mol_assert_not($mol_compare_deep(new User('Jin'), new User('John')));
2166
2123
  },
2167
2124
  });
2168
2125
  })($ || ($ = {}));
2169
- //mol/assert/assert.test.ts
2126
+ //mol/compare/deep/deep.test.tsx
2127
+ ;
2128
+ "use strict";
2129
+ var $;
2130
+ (function ($) {
2131
+ function $mol_dom_serialize(node) {
2132
+ const serializer = new $mol_dom_context.XMLSerializer;
2133
+ return serializer.serializeToString(node);
2134
+ }
2135
+ $.$mol_dom_serialize = $mol_dom_serialize;
2136
+ })($ || ($ = {}));
2137
+ //mol/dom/serialize/serialize.ts
2170
2138
  ;
2171
2139
  "use strict";
2172
2140
  var $;
@@ -2264,6 +2232,84 @@ var $;
2264
2232
  ;
2265
2233
  "use strict";
2266
2234
  var $;
2235
+ (function ($) {
2236
+ $mol_test({
2237
+ 'must be false'() {
2238
+ $mol_assert_not(0);
2239
+ },
2240
+ 'must be true'() {
2241
+ $mol_assert_ok(1);
2242
+ },
2243
+ 'two must be equal'() {
2244
+ $mol_assert_equal(2, 2);
2245
+ },
2246
+ 'three must be equal'() {
2247
+ $mol_assert_equal(2, 2, 2);
2248
+ },
2249
+ 'two must be unique'() {
2250
+ $mol_assert_unique([3], [3]);
2251
+ },
2252
+ 'three must be unique'() {
2253
+ $mol_assert_unique([3], [3], [3]);
2254
+ },
2255
+ 'two must be alike'() {
2256
+ $mol_assert_like([3], [3]);
2257
+ },
2258
+ 'three must be alike'() {
2259
+ $mol_assert_like([3], [3], [3]);
2260
+ },
2261
+ });
2262
+ })($ || ($ = {}));
2263
+ //mol/assert/assert.test.ts
2264
+ ;
2265
+ "use strict";
2266
+ var $;
2267
+ (function ($) {
2268
+ const named = new WeakSet();
2269
+ function $mol_func_name(func) {
2270
+ let name = func.name;
2271
+ if (name?.length > 1)
2272
+ return name;
2273
+ if (named.has(func))
2274
+ return name;
2275
+ for (let key in this) {
2276
+ try {
2277
+ if (this[key] !== func)
2278
+ continue;
2279
+ name = key;
2280
+ Object.defineProperty(func, 'name', { value: name });
2281
+ break;
2282
+ }
2283
+ catch { }
2284
+ }
2285
+ named.add(func);
2286
+ return name;
2287
+ }
2288
+ $.$mol_func_name = $mol_func_name;
2289
+ function $mol_func_name_from(target, source) {
2290
+ Object.defineProperty(target, 'name', { value: source.name });
2291
+ return target;
2292
+ }
2293
+ $.$mol_func_name_from = $mol_func_name_from;
2294
+ })($ || ($ = {}));
2295
+ //mol/func/name/name.ts
2296
+ ;
2297
+ "use strict";
2298
+ var $;
2299
+ (function ($_1) {
2300
+ $mol_test({
2301
+ 'FQN of anon function'($) {
2302
+ const $$ = Object.assign($, { $mol_func_name_test: (() => () => { })() });
2303
+ $mol_assert_equal($$.$mol_func_name_test.name, '');
2304
+ $mol_assert_equal($$.$mol_func_name($$.$mol_func_name_test), '$mol_func_name_test');
2305
+ $mol_assert_equal($$.$mol_func_name_test.name, '$mol_func_name_test');
2306
+ },
2307
+ });
2308
+ })($ || ($ = {}));
2309
+ //mol/func/name/name.test.ts
2310
+ ;
2311
+ "use strict";
2312
+ var $;
2267
2313
  (function ($) {
2268
2314
  $mol_test({
2269
2315
  'get'() {
@@ -2330,182 +2376,6 @@ var $;
2330
2376
  ;
2331
2377
  "use strict";
2332
2378
  var $;
2333
- (function ($_1) {
2334
- $mol_test({
2335
- 'span for same uri'($) {
2336
- const span = new $mol_span('test.ts', '', 1, 3, 4);
2337
- const child = span.span(4, 5, 8);
2338
- $mol_assert_equal(child.uri, 'test.ts');
2339
- $mol_assert_equal(child.row, 4);
2340
- $mol_assert_equal(child.col, 5);
2341
- $mol_assert_equal(child.length, 8);
2342
- },
2343
- 'span after of given position'($) {
2344
- const span = new $mol_span('test.ts', '', 1, 3, 4);
2345
- const child = span.after(11);
2346
- $mol_assert_equal(child.uri, 'test.ts');
2347
- $mol_assert_equal(child.row, 1);
2348
- $mol_assert_equal(child.col, 7);
2349
- $mol_assert_equal(child.length, 11);
2350
- },
2351
- 'slice span - regular'($) {
2352
- const span = new $mol_span('test.ts', '', 1, 3, 5);
2353
- const child = span.slice(1, 4);
2354
- $mol_assert_equal(child.row, 1);
2355
- $mol_assert_equal(child.col, 4);
2356
- $mol_assert_equal(child.length, 3);
2357
- const child2 = span.slice(2, 2);
2358
- $mol_assert_equal(child2.col, 5);
2359
- $mol_assert_equal(child2.length, 0);
2360
- },
2361
- 'slice span - negative'($) {
2362
- const span = new $mol_span('test.ts', '', 1, 3, 5);
2363
- const child = span.slice(-3, -1);
2364
- $mol_assert_equal(child.row, 1);
2365
- $mol_assert_equal(child.col, 5);
2366
- $mol_assert_equal(child.length, 2);
2367
- },
2368
- 'slice span - out of range'($) {
2369
- const span = new $mol_span('test.ts', '', 1, 3, 5);
2370
- $mol_assert_fail(() => span.slice(-1, 3));
2371
- $mol_assert_fail(() => span.slice(1, 6));
2372
- $mol_assert_fail(() => span.slice(1, 10));
2373
- },
2374
- 'error handling'($) {
2375
- const span = new $mol_span('test.ts', '', 1, 3, 4);
2376
- const error = span.error('Some error\n');
2377
- $mol_assert_equal(error.message, 'Some error\ntest.ts#1:3/4');
2378
- }
2379
- });
2380
- })($ || ($ = {}));
2381
- //mol/span/span.test.ts
2382
- ;
2383
- "use strict";
2384
- var $;
2385
- (function ($_1) {
2386
- $mol_test({
2387
- 'tree parsing'($) {
2388
- $mol_assert_equal($.$mol_tree2_from_string("foo\nbar\n").kids.length, 2);
2389
- $mol_assert_equal($.$mol_tree2_from_string("foo\nbar\n").kids[1].type, "bar");
2390
- $mol_assert_equal($.$mol_tree2_from_string("foo\n\n\n").kids.length, 1);
2391
- $mol_assert_equal($.$mol_tree2_from_string("=foo\n\\bar\n").kids.length, 2);
2392
- $mol_assert_equal($.$mol_tree2_from_string("=foo\n\\bar\n").kids[1].value, "bar");
2393
- $mol_assert_equal($.$mol_tree2_from_string("foo bar \\pol\n").kids[0].kids[0].kids[0].value, "pol");
2394
- $mol_assert_equal($.$mol_tree2_from_string("foo bar\n\t\\pol\n\t\\men\n").kids[0].kids[0].kids[1].value, "men");
2395
- $mol_assert_equal($.$mol_tree2_from_string('foo bar \\text\n').toString(), 'foo bar \\text\n');
2396
- },
2397
- 'Too many tabs'($) {
2398
- const tree = `
2399
- foo
2400
- bar
2401
- `;
2402
- $mol_assert_fail(() => {
2403
- $.$mol_tree2_from_string(tree, 'test');
2404
- }, 'Too many tabs\ntest#3:1/6\n!!!!!!\n\t\t\t\t\t\tbar');
2405
- },
2406
- 'Too few tabs'($) {
2407
- const tree = `
2408
- foo
2409
- bar
2410
- `;
2411
- $mol_assert_fail(() => {
2412
- $.$mol_tree2_from_string(tree, 'test');
2413
- }, 'Too few tabs\ntest#3:1/4\n!!!!\n\t\t\t\tbar');
2414
- },
2415
- 'Wrong nodes separator'($) {
2416
- const tree = `foo bar\n`;
2417
- $mol_assert_fail(() => {
2418
- $.$mol_tree2_from_string(tree, 'test');
2419
- }, 'Wrong nodes separator\ntest#1:4/2\n !!\nfoo bar');
2420
- },
2421
- 'Undexpected EOF, LF required'($) {
2422
- const tree = ` foo`;
2423
- $mol_assert_fail(() => {
2424
- $.$mol_tree2_from_string(tree, 'test');
2425
- }, 'Undexpected EOF, LF required\ntest#1:5/1\n !\n foo');
2426
- },
2427
- 'Errors skip and collect'($) {
2428
- const tree = `foo bar`;
2429
- const errors = [];
2430
- const $$ = $.$mol_ambient({
2431
- $mol_fail: (error) => {
2432
- errors.push(error.message);
2433
- return null;
2434
- }
2435
- });
2436
- const res = $$.$mol_tree2_from_string(tree, 'test');
2437
- $mol_assert_like(errors, [
2438
- 'Wrong nodes separator\ntest#1:4/2\n !!\nfoo bar',
2439
- 'Undexpected EOF, LF required\ntest#1:9/1\n !\nfoo bar',
2440
- ]);
2441
- $mol_assert_equal(res.toString(), 'foo bar\n');
2442
- },
2443
- });
2444
- })($ || ($ = {}));
2445
- //mol/tree2/from/string/string.test.ts
2446
- ;
2447
- "use strict";
2448
- var $;
2449
- (function ($_1) {
2450
- $mol_test({
2451
- 'tree parsing'() {
2452
- $mol_assert_equal($mol_tree.fromString("foo\nbar\n").sub.length, 2);
2453
- $mol_assert_equal($mol_tree.fromString("foo\nbar\n").sub[1].type, "bar");
2454
- $mol_assert_equal($mol_tree.fromString("foo\n\n\n").sub.length, 1);
2455
- $mol_assert_equal($mol_tree.fromString("=foo\n\\bar\n").sub.length, 2);
2456
- $mol_assert_equal($mol_tree.fromString("=foo\n\\bar\n").sub[1].data, "bar");
2457
- $mol_assert_equal($mol_tree.fromString("foo bar \\pol").sub[0].sub[0].sub[0].data, "pol");
2458
- $mol_assert_equal($mol_tree.fromString("foo bar\n\t\\pol\n\t\\men").sub[0].sub[0].sub[1].data, "men");
2459
- $mol_assert_equal($mol_tree.fromString('foo bar \\text\n').toString(), 'foo bar \\text\n');
2460
- },
2461
- 'inserting'() {
2462
- $mol_assert_equal($mol_tree.fromString('a b c d').insert(new $mol_tree, 'a', 'b', 'c').toString(), 'a b \\\n');
2463
- $mol_assert_equal($mol_tree.fromString('a b').insert(new $mol_tree, 'a', 'b', 'c', 'd').toString(), 'a b c \\\n');
2464
- $mol_assert_equal($mol_tree.fromString('a b c d').insert(new $mol_tree, 0, 0, 0).toString(), 'a b \\\n');
2465
- $mol_assert_equal($mol_tree.fromString('a b').insert(new $mol_tree, 0, 0, 0, 0).toString(), 'a b \\\n\t\\\n');
2466
- $mol_assert_equal($mol_tree.fromString('a b c d').insert(new $mol_tree, null, null, null).toString(), 'a b \\\n');
2467
- $mol_assert_equal($mol_tree.fromString('a b').insert(new $mol_tree, null, null, null, null).toString(), 'a b \\\n\t\\\n');
2468
- },
2469
- 'fromJSON'() {
2470
- $mol_assert_equal($mol_tree.fromJSON([]).toString(), '/\n');
2471
- $mol_assert_equal($mol_tree.fromJSON([false, true]).toString(), '/\n\tfalse\n\ttrue\n');
2472
- $mol_assert_equal($mol_tree.fromJSON([0, 1, 2.3]).toString(), '/\n\t0\n\t1\n\t2.3\n');
2473
- $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');
2474
- $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');
2475
- },
2476
- 'toJSON'() {
2477
- $mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n').sub[0]), '[]');
2478
- $mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n\tfalse\n\ttrue\n').sub[0]), '[false,true]');
2479
- $mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n\t0\n\t1\n\t2.3\n').sub[0]), '[0,1,2.3]');
2480
- $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"]');
2481
- $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"}');
2482
- },
2483
- 'hack'() {
2484
- const res = $mol_tree.fromString(`foo bar xxx`).hack({
2485
- '': (tree, context) => [tree.hack(context)],
2486
- 'bar': (tree, context) => [tree.hack(context).clone({ type: '777' })],
2487
- });
2488
- $mol_assert_equal(res.toString(), new $mol_tree({ type: 'foo 777 xxx' }).toString());
2489
- },
2490
- 'errors handling'($) {
2491
- const errors = [];
2492
- class Tree extends $mol_tree {
2493
- static $ = $.$mol_ambient({
2494
- $mol_fail: error => errors.push(error.message)
2495
- });
2496
- }
2497
- Tree.fromString(`
2498
- \t \tfoo
2499
- bar \\data
2500
- `, 'test');
2501
- $mol_assert_like(errors, ['Syntax error at test:2\n \tfoo']);
2502
- },
2503
- });
2504
- })($ || ($ = {}));
2505
- //mol/tree/tree.test.ts
2506
- ;
2507
- "use strict";
2508
- var $;
2509
2379
  (function ($) {
2510
2380
  $.$mol_tree_convert = Symbol('$mol_tree_convert');
2511
2381
  class $mol_tree extends $mol_object2 {
@@ -2838,47 +2708,177 @@ var $;
2838
2708
  var $;
2839
2709
  (function ($_1) {
2840
2710
  $mol_test({
2841
- 'FQN of anon function'($) {
2842
- const $$ = Object.assign($, { $mol_func_name_test: (() => () => { })() });
2843
- $mol_assert_equal($$.$mol_func_name_test.name, '');
2844
- $mol_assert_equal($$.$mol_func_name($$.$mol_func_name_test), '$mol_func_name_test');
2845
- $mol_assert_equal($$.$mol_func_name_test.name, '$mol_func_name_test');
2711
+ 'tree parsing'() {
2712
+ $mol_assert_equal($mol_tree.fromString("foo\nbar\n").sub.length, 2);
2713
+ $mol_assert_equal($mol_tree.fromString("foo\nbar\n").sub[1].type, "bar");
2714
+ $mol_assert_equal($mol_tree.fromString("foo\n\n\n").sub.length, 1);
2715
+ $mol_assert_equal($mol_tree.fromString("=foo\n\\bar\n").sub.length, 2);
2716
+ $mol_assert_equal($mol_tree.fromString("=foo\n\\bar\n").sub[1].data, "bar");
2717
+ $mol_assert_equal($mol_tree.fromString("foo bar \\pol").sub[0].sub[0].sub[0].data, "pol");
2718
+ $mol_assert_equal($mol_tree.fromString("foo bar\n\t\\pol\n\t\\men").sub[0].sub[0].sub[1].data, "men");
2719
+ $mol_assert_equal($mol_tree.fromString('foo bar \\text\n').toString(), 'foo bar \\text\n');
2720
+ },
2721
+ 'inserting'() {
2722
+ $mol_assert_equal($mol_tree.fromString('a b c d').insert(new $mol_tree, 'a', 'b', 'c').toString(), 'a b \\\n');
2723
+ $mol_assert_equal($mol_tree.fromString('a b').insert(new $mol_tree, 'a', 'b', 'c', 'd').toString(), 'a b c \\\n');
2724
+ $mol_assert_equal($mol_tree.fromString('a b c d').insert(new $mol_tree, 0, 0, 0).toString(), 'a b \\\n');
2725
+ $mol_assert_equal($mol_tree.fromString('a b').insert(new $mol_tree, 0, 0, 0, 0).toString(), 'a b \\\n\t\\\n');
2726
+ $mol_assert_equal($mol_tree.fromString('a b c d').insert(new $mol_tree, null, null, null).toString(), 'a b \\\n');
2727
+ $mol_assert_equal($mol_tree.fromString('a b').insert(new $mol_tree, null, null, null, null).toString(), 'a b \\\n\t\\\n');
2728
+ },
2729
+ 'fromJSON'() {
2730
+ $mol_assert_equal($mol_tree.fromJSON([]).toString(), '/\n');
2731
+ $mol_assert_equal($mol_tree.fromJSON([false, true]).toString(), '/\n\tfalse\n\ttrue\n');
2732
+ $mol_assert_equal($mol_tree.fromJSON([0, 1, 2.3]).toString(), '/\n\t0\n\t1\n\t2.3\n');
2733
+ $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');
2734
+ $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');
2735
+ },
2736
+ 'toJSON'() {
2737
+ $mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n').sub[0]), '[]');
2738
+ $mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n\tfalse\n\ttrue\n').sub[0]), '[false,true]');
2739
+ $mol_assert_equal(JSON.stringify($mol_tree.fromString('/\n\t0\n\t1\n\t2.3\n').sub[0]), '[0,1,2.3]');
2740
+ $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"]');
2741
+ $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"}');
2742
+ },
2743
+ 'hack'() {
2744
+ const res = $mol_tree.fromString(`foo bar xxx`).hack({
2745
+ '': (tree, context) => [tree.hack(context)],
2746
+ 'bar': (tree, context) => [tree.hack(context).clone({ type: '777' })],
2747
+ });
2748
+ $mol_assert_equal(res.toString(), new $mol_tree({ type: 'foo 777 xxx' }).toString());
2749
+ },
2750
+ 'errors handling'($) {
2751
+ const errors = [];
2752
+ class Tree extends $mol_tree {
2753
+ static $ = $.$mol_ambient({
2754
+ $mol_fail: error => errors.push(error.message)
2755
+ });
2756
+ }
2757
+ Tree.fromString(`
2758
+ \t \tfoo
2759
+ bar \\data
2760
+ `, 'test');
2761
+ $mol_assert_like(errors, ['Syntax error at test:2\n \tfoo']);
2846
2762
  },
2847
2763
  });
2848
2764
  })($ || ($ = {}));
2849
- //mol/func/name/name.test.ts
2765
+ //mol/tree/tree.test.ts
2850
2766
  ;
2851
2767
  "use strict";
2852
2768
  var $;
2853
- (function ($) {
2854
- const named = new WeakSet();
2855
- function $mol_func_name(func) {
2856
- let name = func.name;
2857
- if (name?.length > 1)
2858
- return name;
2859
- if (named.has(func))
2860
- return name;
2861
- for (let key in this) {
2862
- try {
2863
- if (this[key] !== func)
2864
- continue;
2865
- name = key;
2866
- Object.defineProperty(func, 'name', { value: name });
2867
- break;
2868
- }
2869
- catch { }
2769
+ (function ($_1) {
2770
+ $mol_test({
2771
+ 'span for same uri'($) {
2772
+ const span = new $mol_span('test.ts', '', 1, 3, 4);
2773
+ const child = span.span(4, 5, 8);
2774
+ $mol_assert_equal(child.uri, 'test.ts');
2775
+ $mol_assert_equal(child.row, 4);
2776
+ $mol_assert_equal(child.col, 5);
2777
+ $mol_assert_equal(child.length, 8);
2778
+ },
2779
+ 'span after of given position'($) {
2780
+ const span = new $mol_span('test.ts', '', 1, 3, 4);
2781
+ const child = span.after(11);
2782
+ $mol_assert_equal(child.uri, 'test.ts');
2783
+ $mol_assert_equal(child.row, 1);
2784
+ $mol_assert_equal(child.col, 7);
2785
+ $mol_assert_equal(child.length, 11);
2786
+ },
2787
+ 'slice span - regular'($) {
2788
+ const span = new $mol_span('test.ts', '', 1, 3, 5);
2789
+ const child = span.slice(1, 4);
2790
+ $mol_assert_equal(child.row, 1);
2791
+ $mol_assert_equal(child.col, 4);
2792
+ $mol_assert_equal(child.length, 3);
2793
+ const child2 = span.slice(2, 2);
2794
+ $mol_assert_equal(child2.col, 5);
2795
+ $mol_assert_equal(child2.length, 0);
2796
+ },
2797
+ 'slice span - negative'($) {
2798
+ const span = new $mol_span('test.ts', '', 1, 3, 5);
2799
+ const child = span.slice(-3, -1);
2800
+ $mol_assert_equal(child.row, 1);
2801
+ $mol_assert_equal(child.col, 5);
2802
+ $mol_assert_equal(child.length, 2);
2803
+ },
2804
+ 'slice span - out of range'($) {
2805
+ const span = new $mol_span('test.ts', '', 1, 3, 5);
2806
+ $mol_assert_fail(() => span.slice(-1, 3));
2807
+ $mol_assert_fail(() => span.slice(1, 6));
2808
+ $mol_assert_fail(() => span.slice(1, 10));
2809
+ },
2810
+ 'error handling'($) {
2811
+ const span = new $mol_span('test.ts', '', 1, 3, 4);
2812
+ const error = span.error('Some error\n');
2813
+ $mol_assert_equal(error.message, 'Some error\ntest.ts#1:3/4');
2870
2814
  }
2871
- named.add(func);
2872
- return name;
2873
- }
2874
- $.$mol_func_name = $mol_func_name;
2875
- function $mol_func_name_from(target, source) {
2876
- Object.defineProperty(target, 'name', { value: source.name });
2877
- return target;
2878
- }
2879
- $.$mol_func_name_from = $mol_func_name_from;
2815
+ });
2880
2816
  })($ || ($ = {}));
2881
- //mol/func/name/name.ts
2817
+ //mol/span/span.test.ts
2818
+ ;
2819
+ "use strict";
2820
+ var $;
2821
+ (function ($_1) {
2822
+ $mol_test({
2823
+ 'tree parsing'($) {
2824
+ $mol_assert_equal($.$mol_tree2_from_string("foo\nbar\n").kids.length, 2);
2825
+ $mol_assert_equal($.$mol_tree2_from_string("foo\nbar\n").kids[1].type, "bar");
2826
+ $mol_assert_equal($.$mol_tree2_from_string("foo\n\n\n").kids.length, 1);
2827
+ $mol_assert_equal($.$mol_tree2_from_string("=foo\n\\bar\n").kids.length, 2);
2828
+ $mol_assert_equal($.$mol_tree2_from_string("=foo\n\\bar\n").kids[1].value, "bar");
2829
+ $mol_assert_equal($.$mol_tree2_from_string("foo bar \\pol\n").kids[0].kids[0].kids[0].value, "pol");
2830
+ $mol_assert_equal($.$mol_tree2_from_string("foo bar\n\t\\pol\n\t\\men\n").kids[0].kids[0].kids[1].value, "men");
2831
+ $mol_assert_equal($.$mol_tree2_from_string('foo bar \\text\n').toString(), 'foo bar \\text\n');
2832
+ },
2833
+ 'Too many tabs'($) {
2834
+ const tree = `
2835
+ foo
2836
+ bar
2837
+ `;
2838
+ $mol_assert_fail(() => {
2839
+ $.$mol_tree2_from_string(tree, 'test');
2840
+ }, 'Too many tabs\ntest#3:1/6\n!!!!!!\n\t\t\t\t\t\tbar');
2841
+ },
2842
+ 'Too few tabs'($) {
2843
+ const tree = `
2844
+ foo
2845
+ bar
2846
+ `;
2847
+ $mol_assert_fail(() => {
2848
+ $.$mol_tree2_from_string(tree, 'test');
2849
+ }, 'Too few tabs\ntest#3:1/4\n!!!!\n\t\t\t\tbar');
2850
+ },
2851
+ 'Wrong nodes separator'($) {
2852
+ const tree = `foo bar\n`;
2853
+ $mol_assert_fail(() => {
2854
+ $.$mol_tree2_from_string(tree, 'test');
2855
+ }, 'Wrong nodes separator\ntest#1:4/2\n !!\nfoo bar');
2856
+ },
2857
+ 'Undexpected EOF, LF required'($) {
2858
+ const tree = ` foo`;
2859
+ $mol_assert_fail(() => {
2860
+ $.$mol_tree2_from_string(tree, 'test');
2861
+ }, 'Undexpected EOF, LF required\ntest#1:5/1\n !\n foo');
2862
+ },
2863
+ 'Errors skip and collect'($) {
2864
+ const tree = `foo bar`;
2865
+ const errors = [];
2866
+ const $$ = $.$mol_ambient({
2867
+ $mol_fail: (error) => {
2868
+ errors.push(error.message);
2869
+ return null;
2870
+ }
2871
+ });
2872
+ const res = $$.$mol_tree2_from_string(tree, 'test');
2873
+ $mol_assert_like(errors, [
2874
+ 'Wrong nodes separator\ntest#1:4/2\n !!\nfoo bar',
2875
+ 'Undexpected EOF, LF required\ntest#1:9/1\n !\nfoo bar',
2876
+ ]);
2877
+ $mol_assert_equal(res.toString(), 'foo bar\n');
2878
+ },
2879
+ });
2880
+ })($ || ($ = {}));
2881
+ //mol/tree2/from/string/string.test.ts
2882
2882
  ;
2883
2883
  "use strict";
2884
2884
  var $;
@@ -2942,19 +2942,32 @@ var $;
2942
2942
  //mol/type/unary/unary.ts
2943
2943
  ;
2944
2944
  "use strict";
2945
+ //mol/type/param/param.ts
2946
+ ;
2947
+ "use strict";
2945
2948
  //mol/type/param/param.test.ts
2946
2949
  ;
2947
2950
  "use strict";
2948
- //mol/type/param/param.ts
2951
+ //mol/type/tail/tail.ts
2949
2952
  ;
2950
2953
  "use strict";
2951
2954
  //mol/type/tail/tail.test.ts
2952
2955
  ;
2953
2956
  "use strict";
2954
- //mol/type/tail/tail.ts
2957
+ //mol/data/value/value.ts
2955
2958
  ;
2956
2959
  "use strict";
2957
- //mol/data/value/value.ts
2960
+ var $;
2961
+ (function ($) {
2962
+ function $mol_data_setup(value, config) {
2963
+ return Object.assign(value, {
2964
+ config,
2965
+ Value: null
2966
+ });
2967
+ }
2968
+ $.$mol_data_setup = $mol_data_setup;
2969
+ })($ || ($ = {}));
2970
+ //mol/data/setup/setup.ts
2958
2971
  ;
2959
2972
  "use strict";
2960
2973
  var $;
@@ -2971,15 +2984,12 @@ var $;
2971
2984
  "use strict";
2972
2985
  var $;
2973
2986
  (function ($) {
2974
- function $mol_data_setup(value, config) {
2975
- return Object.assign(value, {
2976
- config,
2977
- Value: null
2978
- });
2987
+ function $mol_func_is_class(func) {
2988
+ return Object.getOwnPropertyDescriptor(func, 'prototype')?.writable === false;
2979
2989
  }
2980
- $.$mol_data_setup = $mol_data_setup;
2990
+ $.$mol_func_is_class = $mol_func_is_class;
2981
2991
  })($ || ($ = {}));
2982
- //mol/data/setup/setup.ts
2992
+ //mol/func/is/class/class.ts
2983
2993
  ;
2984
2994
  "use strict";
2985
2995
  var $;
@@ -3010,26 +3020,31 @@ var $;
3010
3020
  //mol/func/is/class/class.test.ts
3011
3021
  ;
3012
3022
  "use strict";
3013
- var $;
3014
- (function ($) {
3015
- function $mol_func_is_class(func) {
3016
- return Object.getOwnPropertyDescriptor(func, 'prototype')?.writable === false;
3017
- }
3018
- $.$mol_func_is_class = $mol_func_is_class;
3019
- })($ || ($ = {}));
3020
- //mol/func/is/class/class.ts
3023
+ //mol/type/result/result.ts
3021
3024
  ;
3022
3025
  "use strict";
3023
3026
  //mol/type/result/result.test.ts
3024
3027
  ;
3025
3028
  "use strict";
3026
- //mol/type/result/result.ts
3029
+ //mol/type/foot/foot.ts
3027
3030
  ;
3028
3031
  "use strict";
3029
3032
  //mol/type/foot/foot.test.ts
3030
3033
  ;
3031
3034
  "use strict";
3032
- //mol/type/foot/foot.ts
3035
+ var $;
3036
+ (function ($) {
3037
+ function $mol_data_pipe(...funcs) {
3038
+ return $mol_data_setup(function (input) {
3039
+ let value = input;
3040
+ for (const func of funcs)
3041
+ value = $mol_func_is_class(func) ? new func(value) : func.call(this, value);
3042
+ return value;
3043
+ }, { funcs });
3044
+ }
3045
+ $.$mol_data_pipe = $mol_data_pipe;
3046
+ })($ || ($ = {}));
3047
+ //mol/data/pipe/pipe.ts
3033
3048
  ;
3034
3049
  "use strict";
3035
3050
  var $;
@@ -3065,21 +3080,6 @@ var $;
3065
3080
  ;
3066
3081
  "use strict";
3067
3082
  var $;
3068
- (function ($) {
3069
- function $mol_data_pipe(...funcs) {
3070
- return $mol_data_setup(function (input) {
3071
- let value = input;
3072
- for (const func of funcs)
3073
- value = $mol_func_is_class(func) ? new func(value) : func.call(this, value);
3074
- return value;
3075
- }, { funcs });
3076
- }
3077
- $.$mol_data_pipe = $mol_data_pipe;
3078
- })($ || ($ = {}));
3079
- //mol/data/pipe/pipe.ts
3080
- ;
3081
- "use strict";
3082
- var $;
3083
3083
  (function ($) {
3084
3084
  const convert = $mol_data_pipe($mol_tree2_from_string, $mol_tree2_js_to_text, $mol_tree2_text_to_string);
3085
3085
  $mol_test({