mol_tree2 1.0.213 → 1.0.214
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 +372 -372
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.test.js +246 -246
- package/web.test.js.map +1 -1
package/package.json
CHANGED
package/web.test.js
CHANGED
|
@@ -165,25 +165,25 @@ var $;
|
|
|
165
165
|
//mol/dom/render/children/children.ts
|
|
166
166
|
;
|
|
167
167
|
"use strict";
|
|
168
|
-
//mol/type/
|
|
168
|
+
//mol/type/error/error.ts
|
|
169
169
|
;
|
|
170
170
|
"use strict";
|
|
171
|
-
//mol/type/
|
|
171
|
+
//mol/type/assert/assert.test.ts
|
|
172
172
|
;
|
|
173
173
|
"use strict";
|
|
174
174
|
//mol/type/assert/assert.ts
|
|
175
175
|
;
|
|
176
176
|
"use strict";
|
|
177
|
-
//mol/type/
|
|
177
|
+
//mol/type/equals/equals.test.ts
|
|
178
178
|
;
|
|
179
179
|
"use strict";
|
|
180
180
|
//mol/type/equals/equals.ts
|
|
181
181
|
;
|
|
182
182
|
"use strict";
|
|
183
|
-
//mol/type/
|
|
183
|
+
//mol/type/partial/deep/deep.test.ts
|
|
184
184
|
;
|
|
185
185
|
"use strict";
|
|
186
|
-
//mol/type/partial/deep/deep.
|
|
186
|
+
//mol/type/partial/deep/deep.ts
|
|
187
187
|
;
|
|
188
188
|
"use strict";
|
|
189
189
|
var $;
|
|
@@ -630,6 +630,38 @@ var $;
|
|
|
630
630
|
;
|
|
631
631
|
"use strict";
|
|
632
632
|
var $;
|
|
633
|
+
(function ($) {
|
|
634
|
+
$mol_test({
|
|
635
|
+
'must be false'() {
|
|
636
|
+
$mol_assert_not(0);
|
|
637
|
+
},
|
|
638
|
+
'must be true'() {
|
|
639
|
+
$mol_assert_ok(1);
|
|
640
|
+
},
|
|
641
|
+
'two must be equal'() {
|
|
642
|
+
$mol_assert_equal(2, 2);
|
|
643
|
+
},
|
|
644
|
+
'three must be equal'() {
|
|
645
|
+
$mol_assert_equal(2, 2, 2);
|
|
646
|
+
},
|
|
647
|
+
'two must be unique'() {
|
|
648
|
+
$mol_assert_unique([3], [3]);
|
|
649
|
+
},
|
|
650
|
+
'three must be unique'() {
|
|
651
|
+
$mol_assert_unique([3], [3], [3]);
|
|
652
|
+
},
|
|
653
|
+
'two must be alike'() {
|
|
654
|
+
$mol_assert_like([3], [3]);
|
|
655
|
+
},
|
|
656
|
+
'three must be alike'() {
|
|
657
|
+
$mol_assert_like([3], [3], [3]);
|
|
658
|
+
},
|
|
659
|
+
});
|
|
660
|
+
})($ || ($ = {}));
|
|
661
|
+
//mol/assert/assert.test.ts
|
|
662
|
+
;
|
|
663
|
+
"use strict";
|
|
664
|
+
var $;
|
|
633
665
|
(function ($) {
|
|
634
666
|
function $mol_assert_ok(value) {
|
|
635
667
|
if (value)
|
|
@@ -724,157 +756,6 @@ var $;
|
|
|
724
756
|
;
|
|
725
757
|
"use strict";
|
|
726
758
|
var $;
|
|
727
|
-
(function ($) {
|
|
728
|
-
$mol_test({
|
|
729
|
-
'must be false'() {
|
|
730
|
-
$mol_assert_not(0);
|
|
731
|
-
},
|
|
732
|
-
'must be true'() {
|
|
733
|
-
$mol_assert_ok(1);
|
|
734
|
-
},
|
|
735
|
-
'two must be equal'() {
|
|
736
|
-
$mol_assert_equal(2, 2);
|
|
737
|
-
},
|
|
738
|
-
'three must be equal'() {
|
|
739
|
-
$mol_assert_equal(2, 2, 2);
|
|
740
|
-
},
|
|
741
|
-
'two must be unique'() {
|
|
742
|
-
$mol_assert_unique([3], [3]);
|
|
743
|
-
},
|
|
744
|
-
'three must be unique'() {
|
|
745
|
-
$mol_assert_unique([3], [3], [3]);
|
|
746
|
-
},
|
|
747
|
-
'two must be alike'() {
|
|
748
|
-
$mol_assert_like([3], [3]);
|
|
749
|
-
},
|
|
750
|
-
'three must be alike'() {
|
|
751
|
-
$mol_assert_like([3], [3], [3]);
|
|
752
|
-
},
|
|
753
|
-
});
|
|
754
|
-
})($ || ($ = {}));
|
|
755
|
-
//mol/assert/assert.test.ts
|
|
756
|
-
;
|
|
757
|
-
"use strict";
|
|
758
|
-
var $;
|
|
759
|
-
(function ($) {
|
|
760
|
-
function $mol_log3_area_lazy(event) {
|
|
761
|
-
const self = this;
|
|
762
|
-
const stack = self.$mol_log3_stack;
|
|
763
|
-
const deep = stack.length;
|
|
764
|
-
let logged = false;
|
|
765
|
-
stack.push(() => {
|
|
766
|
-
logged = true;
|
|
767
|
-
self.$mol_log3_area.call(self, event);
|
|
768
|
-
});
|
|
769
|
-
return () => {
|
|
770
|
-
if (logged)
|
|
771
|
-
self.console.groupEnd();
|
|
772
|
-
if (stack.length > deep)
|
|
773
|
-
stack.length = deep;
|
|
774
|
-
};
|
|
775
|
-
}
|
|
776
|
-
$.$mol_log3_area_lazy = $mol_log3_area_lazy;
|
|
777
|
-
$.$mol_log3_stack = [];
|
|
778
|
-
})($ || ($ = {}));
|
|
779
|
-
//mol/log3/log3.ts
|
|
780
|
-
;
|
|
781
|
-
"use strict";
|
|
782
|
-
//mol/type/keys/extract/extract.ts
|
|
783
|
-
;
|
|
784
|
-
"use strict";
|
|
785
|
-
//mol/type/keys/extract/extract.test.ts
|
|
786
|
-
;
|
|
787
|
-
"use strict";
|
|
788
|
-
var $;
|
|
789
|
-
(function ($_1) {
|
|
790
|
-
$mol_test_mocks.push($ => {
|
|
791
|
-
$.$mol_log3_come = () => { };
|
|
792
|
-
$.$mol_log3_done = () => { };
|
|
793
|
-
$.$mol_log3_fail = () => { };
|
|
794
|
-
$.$mol_log3_warn = () => { };
|
|
795
|
-
$.$mol_log3_rise = () => { };
|
|
796
|
-
$.$mol_log3_area = () => () => { };
|
|
797
|
-
});
|
|
798
|
-
})($ || ($ = {}));
|
|
799
|
-
//mol/log3/log3.test.ts
|
|
800
|
-
;
|
|
801
|
-
"use strict";
|
|
802
|
-
var $;
|
|
803
|
-
(function ($) {
|
|
804
|
-
function $mol_log3_web_make(level, color) {
|
|
805
|
-
return function $mol_log3_logger(event) {
|
|
806
|
-
const pending = this.$mol_log3_stack.pop();
|
|
807
|
-
if (pending)
|
|
808
|
-
pending();
|
|
809
|
-
let tpl = '%c';
|
|
810
|
-
const chunks = Object.values(event);
|
|
811
|
-
for (let i = 0; i < chunks.length; ++i) {
|
|
812
|
-
tpl += (typeof chunks[i] === 'string') ? ' ⦙ %s' : ' ⦙ %o';
|
|
813
|
-
}
|
|
814
|
-
const style = `color:${color};font-weight:bolder`;
|
|
815
|
-
this.console[level](tpl, style, ...chunks);
|
|
816
|
-
const self = this;
|
|
817
|
-
return () => self.console.groupEnd();
|
|
818
|
-
};
|
|
819
|
-
}
|
|
820
|
-
$.$mol_log3_web_make = $mol_log3_web_make;
|
|
821
|
-
$.$mol_log3_come = $mol_log3_web_make('info', 'royalblue');
|
|
822
|
-
$.$mol_log3_done = $mol_log3_web_make('info', 'forestgreen');
|
|
823
|
-
$.$mol_log3_fail = $mol_log3_web_make('error', 'orangered');
|
|
824
|
-
$.$mol_log3_warn = $mol_log3_web_make('warn', 'goldenrod');
|
|
825
|
-
$.$mol_log3_rise = $mol_log3_web_make('log', 'magenta');
|
|
826
|
-
$.$mol_log3_area = $mol_log3_web_make('group', 'cyan');
|
|
827
|
-
})($ || ($ = {}));
|
|
828
|
-
//mol/log3/log3.web.ts
|
|
829
|
-
;
|
|
830
|
-
"use strict";
|
|
831
|
-
var $;
|
|
832
|
-
(function ($) {
|
|
833
|
-
const named = new WeakSet();
|
|
834
|
-
function $mol_func_name(func) {
|
|
835
|
-
let name = func.name;
|
|
836
|
-
if (name?.length > 1)
|
|
837
|
-
return name;
|
|
838
|
-
if (named.has(func))
|
|
839
|
-
return name;
|
|
840
|
-
for (let key in this) {
|
|
841
|
-
try {
|
|
842
|
-
if (this[key] !== func)
|
|
843
|
-
continue;
|
|
844
|
-
name = key;
|
|
845
|
-
Object.defineProperty(func, 'name', { value: name });
|
|
846
|
-
break;
|
|
847
|
-
}
|
|
848
|
-
catch { }
|
|
849
|
-
}
|
|
850
|
-
named.add(func);
|
|
851
|
-
return name;
|
|
852
|
-
}
|
|
853
|
-
$.$mol_func_name = $mol_func_name;
|
|
854
|
-
function $mol_func_name_from(target, source) {
|
|
855
|
-
Object.defineProperty(target, 'name', { value: source.name });
|
|
856
|
-
return target;
|
|
857
|
-
}
|
|
858
|
-
$.$mol_func_name_from = $mol_func_name_from;
|
|
859
|
-
})($ || ($ = {}));
|
|
860
|
-
//mol/func/name/name.ts
|
|
861
|
-
;
|
|
862
|
-
"use strict";
|
|
863
|
-
var $;
|
|
864
|
-
(function ($_1) {
|
|
865
|
-
$mol_test({
|
|
866
|
-
'FQN of anon function'($) {
|
|
867
|
-
const $$ = Object.assign($, { $mol_func_name_test: (() => () => { })() });
|
|
868
|
-
$mol_assert_equal($$.$mol_func_name_test.name, '');
|
|
869
|
-
$mol_assert_equal($$.$mol_func_name($$.$mol_func_name_test), '$mol_func_name_test');
|
|
870
|
-
$mol_assert_equal($$.$mol_func_name_test.name, '$mol_func_name_test');
|
|
871
|
-
},
|
|
872
|
-
});
|
|
873
|
-
})($ || ($ = {}));
|
|
874
|
-
//mol/func/name/name.test.ts
|
|
875
|
-
;
|
|
876
|
-
"use strict";
|
|
877
|
-
var $;
|
|
878
759
|
(function ($) {
|
|
879
760
|
$mol_test({
|
|
880
761
|
'get'() {
|
|
@@ -993,64 +874,6 @@ var $;
|
|
|
993
874
|
;
|
|
994
875
|
"use strict";
|
|
995
876
|
var $;
|
|
996
|
-
(function ($_1) {
|
|
997
|
-
$mol_test({
|
|
998
|
-
'inserting'($) {
|
|
999
|
-
$mol_assert_equal($.$mol_tree2_from_string('a b c d\n')
|
|
1000
|
-
.insert($mol_tree2.struct('x'), 'a', 'b', 'c')
|
|
1001
|
-
.toString(), 'a b x\n');
|
|
1002
|
-
$mol_assert_equal($.$mol_tree2_from_string('a b\n')
|
|
1003
|
-
.insert($mol_tree2.struct('x'), 'a', 'b', 'c', 'd')
|
|
1004
|
-
.toString(), 'a b c x\n');
|
|
1005
|
-
$mol_assert_equal($.$mol_tree2_from_string('a b c d\n')
|
|
1006
|
-
.insert($mol_tree2.struct('x'), 0, 0, 0)
|
|
1007
|
-
.toString(), 'a b x\n');
|
|
1008
|
-
$mol_assert_equal($.$mol_tree2_from_string('a b\n')
|
|
1009
|
-
.insert($mol_tree2.struct('x'), 0, 0, 0, 0)
|
|
1010
|
-
.toString(), 'a b \\\n\tx\n');
|
|
1011
|
-
$mol_assert_equal($.$mol_tree2_from_string('a b c d\n')
|
|
1012
|
-
.insert($mol_tree2.struct('x'), null, null, null)
|
|
1013
|
-
.toString(), 'a b x\n');
|
|
1014
|
-
$mol_assert_equal($.$mol_tree2_from_string('a b\n')
|
|
1015
|
-
.insert($mol_tree2.struct('x'), null, null, null, null)
|
|
1016
|
-
.toString(), 'a b \\\n\tx\n');
|
|
1017
|
-
},
|
|
1018
|
-
'deleting'($) {
|
|
1019
|
-
$mol_assert_equal($.$mol_tree2_from_string('a b c d\n')
|
|
1020
|
-
.insert(null, 'a', 'b', 'c')
|
|
1021
|
-
.toString(), 'a b\n');
|
|
1022
|
-
$mol_assert_equal($.$mol_tree2_from_string('a b c d\n')
|
|
1023
|
-
.insert(null, 0, 0, 0)
|
|
1024
|
-
.toString(), 'a b\n');
|
|
1025
|
-
},
|
|
1026
|
-
'hack'($) {
|
|
1027
|
-
const res = $.$mol_tree2_from_string(`foo bar xxx\n`)
|
|
1028
|
-
.hack({
|
|
1029
|
-
'bar': (input, belt) => [input.struct('777', input.hack(belt))],
|
|
1030
|
-
});
|
|
1031
|
-
$mol_assert_equal(res.toString(), 'foo 777 xxx\n');
|
|
1032
|
-
},
|
|
1033
|
-
});
|
|
1034
|
-
})($ || ($ = {}));
|
|
1035
|
-
//mol/tree2/tree2.test.ts
|
|
1036
|
-
;
|
|
1037
|
-
"use strict";
|
|
1038
|
-
var $;
|
|
1039
|
-
(function ($) {
|
|
1040
|
-
$mol_test({
|
|
1041
|
-
'fromJSON'() {
|
|
1042
|
-
$mol_assert_equal($mol_tree2_from_json([]).toString(), '/\n');
|
|
1043
|
-
$mol_assert_equal($mol_tree2_from_json([false, true]).toString(), '/\n\tfalse\n\ttrue\n');
|
|
1044
|
-
$mol_assert_equal($mol_tree2_from_json([0, 1, 2.3]).toString(), '/\n\t0\n\t1\n\t2.3\n');
|
|
1045
|
-
$mol_assert_equal($mol_tree2_from_json(['', 'foo', 'bar\nbaz']).toString(), '/\n\t\\\n\t\\foo\n\t\\\n\t\t\\bar\n\t\t\\baz\n');
|
|
1046
|
-
$mol_assert_equal($mol_tree2_from_json({ 'foo': false, 'bar\nbaz': 'lol' }).toString(), '*\n\tfoo false\n\t\\\n\t\t\\bar\n\t\t\\baz\n\t\t\\lol\n');
|
|
1047
|
-
},
|
|
1048
|
-
});
|
|
1049
|
-
})($ || ($ = {}));
|
|
1050
|
-
//mol/tree2/from/json/json.test.ts
|
|
1051
|
-
;
|
|
1052
|
-
"use strict";
|
|
1053
|
-
var $;
|
|
1054
877
|
(function ($_1) {
|
|
1055
878
|
$mol_test({
|
|
1056
879
|
'tree parsing'($) {
|
|
@@ -1114,35 +937,199 @@ var $;
|
|
|
1114
937
|
//mol/tree2/from/string/string.test.ts
|
|
1115
938
|
;
|
|
1116
939
|
"use strict";
|
|
1117
|
-
|
|
940
|
+
var $;
|
|
941
|
+
(function ($) {
|
|
942
|
+
function $mol_log3_area_lazy(event) {
|
|
943
|
+
const self = this;
|
|
944
|
+
const stack = self.$mol_log3_stack;
|
|
945
|
+
const deep = stack.length;
|
|
946
|
+
let logged = false;
|
|
947
|
+
stack.push(() => {
|
|
948
|
+
logged = true;
|
|
949
|
+
self.$mol_log3_area.call(self, event);
|
|
950
|
+
});
|
|
951
|
+
return () => {
|
|
952
|
+
if (logged)
|
|
953
|
+
self.console.groupEnd();
|
|
954
|
+
if (stack.length > deep)
|
|
955
|
+
stack.length = deep;
|
|
956
|
+
};
|
|
957
|
+
}
|
|
958
|
+
$.$mol_log3_area_lazy = $mol_log3_area_lazy;
|
|
959
|
+
$.$mol_log3_stack = [];
|
|
960
|
+
})($ || ($ = {}));
|
|
961
|
+
//mol/log3/log3.ts
|
|
1118
962
|
;
|
|
1119
963
|
"use strict";
|
|
1120
|
-
//mol/type/
|
|
964
|
+
//mol/type/keys/extract/extract.test.ts
|
|
1121
965
|
;
|
|
1122
966
|
"use strict";
|
|
1123
|
-
//mol/type/
|
|
967
|
+
//mol/type/keys/extract/extract.ts
|
|
1124
968
|
;
|
|
1125
969
|
"use strict";
|
|
1126
|
-
|
|
970
|
+
var $;
|
|
971
|
+
(function ($_1) {
|
|
972
|
+
$mol_test_mocks.push($ => {
|
|
973
|
+
$.$mol_log3_come = () => { };
|
|
974
|
+
$.$mol_log3_done = () => { };
|
|
975
|
+
$.$mol_log3_fail = () => { };
|
|
976
|
+
$.$mol_log3_warn = () => { };
|
|
977
|
+
$.$mol_log3_rise = () => { };
|
|
978
|
+
$.$mol_log3_area = () => () => { };
|
|
979
|
+
});
|
|
980
|
+
})($ || ($ = {}));
|
|
981
|
+
//mol/log3/log3.test.ts
|
|
1127
982
|
;
|
|
1128
983
|
"use strict";
|
|
1129
|
-
|
|
984
|
+
var $;
|
|
985
|
+
(function ($) {
|
|
986
|
+
function $mol_log3_web_make(level, color) {
|
|
987
|
+
return function $mol_log3_logger(event) {
|
|
988
|
+
const pending = this.$mol_log3_stack.pop();
|
|
989
|
+
if (pending)
|
|
990
|
+
pending();
|
|
991
|
+
let tpl = '%c';
|
|
992
|
+
const chunks = Object.values(event);
|
|
993
|
+
for (let i = 0; i < chunks.length; ++i) {
|
|
994
|
+
tpl += (typeof chunks[i] === 'string') ? ' ⦙ %s' : ' ⦙ %o';
|
|
995
|
+
}
|
|
996
|
+
const style = `color:${color};font-weight:bolder`;
|
|
997
|
+
this.console[level](tpl, style, ...chunks);
|
|
998
|
+
const self = this;
|
|
999
|
+
return () => self.console.groupEnd();
|
|
1000
|
+
};
|
|
1001
|
+
}
|
|
1002
|
+
$.$mol_log3_web_make = $mol_log3_web_make;
|
|
1003
|
+
$.$mol_log3_come = $mol_log3_web_make('info', 'royalblue');
|
|
1004
|
+
$.$mol_log3_done = $mol_log3_web_make('info', 'forestgreen');
|
|
1005
|
+
$.$mol_log3_fail = $mol_log3_web_make('error', 'orangered');
|
|
1006
|
+
$.$mol_log3_warn = $mol_log3_web_make('warn', 'goldenrod');
|
|
1007
|
+
$.$mol_log3_rise = $mol_log3_web_make('log', 'magenta');
|
|
1008
|
+
$.$mol_log3_area = $mol_log3_web_make('group', 'cyan');
|
|
1009
|
+
})($ || ($ = {}));
|
|
1010
|
+
//mol/log3/log3.web.ts
|
|
1130
1011
|
;
|
|
1131
1012
|
"use strict";
|
|
1132
|
-
|
|
1013
|
+
var $;
|
|
1014
|
+
(function ($_1) {
|
|
1015
|
+
$mol_test({
|
|
1016
|
+
'FQN of anon function'($) {
|
|
1017
|
+
const $$ = Object.assign($, { $mol_func_name_test: (() => () => { })() });
|
|
1018
|
+
$mol_assert_equal($$.$mol_func_name_test.name, '');
|
|
1019
|
+
$mol_assert_equal($$.$mol_func_name($$.$mol_func_name_test), '$mol_func_name_test');
|
|
1020
|
+
$mol_assert_equal($$.$mol_func_name_test.name, '$mol_func_name_test');
|
|
1021
|
+
},
|
|
1022
|
+
});
|
|
1023
|
+
})($ || ($ = {}));
|
|
1024
|
+
//mol/func/name/name.test.ts
|
|
1133
1025
|
;
|
|
1134
1026
|
"use strict";
|
|
1135
1027
|
var $;
|
|
1136
1028
|
(function ($) {
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1029
|
+
const named = new WeakSet();
|
|
1030
|
+
function $mol_func_name(func) {
|
|
1031
|
+
let name = func.name;
|
|
1032
|
+
if (name?.length > 1)
|
|
1033
|
+
return name;
|
|
1034
|
+
if (named.has(func))
|
|
1035
|
+
return name;
|
|
1036
|
+
for (let key in this) {
|
|
1037
|
+
try {
|
|
1038
|
+
if (this[key] !== func)
|
|
1039
|
+
continue;
|
|
1040
|
+
name = key;
|
|
1041
|
+
Object.defineProperty(func, 'name', { value: name });
|
|
1042
|
+
break;
|
|
1043
|
+
}
|
|
1044
|
+
catch { }
|
|
1045
|
+
}
|
|
1046
|
+
named.add(func);
|
|
1047
|
+
return name;
|
|
1142
1048
|
}
|
|
1143
|
-
$.$
|
|
1049
|
+
$.$mol_func_name = $mol_func_name;
|
|
1050
|
+
function $mol_func_name_from(target, source) {
|
|
1051
|
+
Object.defineProperty(target, 'name', { value: source.name });
|
|
1052
|
+
return target;
|
|
1053
|
+
}
|
|
1054
|
+
$.$mol_func_name_from = $mol_func_name_from;
|
|
1144
1055
|
})($ || ($ = {}));
|
|
1145
|
-
//mol/
|
|
1056
|
+
//mol/func/name/name.ts
|
|
1057
|
+
;
|
|
1058
|
+
"use strict";
|
|
1059
|
+
var $;
|
|
1060
|
+
(function ($_1) {
|
|
1061
|
+
$mol_test({
|
|
1062
|
+
'inserting'($) {
|
|
1063
|
+
$mol_assert_equal($.$mol_tree2_from_string('a b c d\n')
|
|
1064
|
+
.insert($mol_tree2.struct('x'), 'a', 'b', 'c')
|
|
1065
|
+
.toString(), 'a b x\n');
|
|
1066
|
+
$mol_assert_equal($.$mol_tree2_from_string('a b\n')
|
|
1067
|
+
.insert($mol_tree2.struct('x'), 'a', 'b', 'c', 'd')
|
|
1068
|
+
.toString(), 'a b c x\n');
|
|
1069
|
+
$mol_assert_equal($.$mol_tree2_from_string('a b c d\n')
|
|
1070
|
+
.insert($mol_tree2.struct('x'), 0, 0, 0)
|
|
1071
|
+
.toString(), 'a b x\n');
|
|
1072
|
+
$mol_assert_equal($.$mol_tree2_from_string('a b\n')
|
|
1073
|
+
.insert($mol_tree2.struct('x'), 0, 0, 0, 0)
|
|
1074
|
+
.toString(), 'a b \\\n\tx\n');
|
|
1075
|
+
$mol_assert_equal($.$mol_tree2_from_string('a b c d\n')
|
|
1076
|
+
.insert($mol_tree2.struct('x'), null, null, null)
|
|
1077
|
+
.toString(), 'a b x\n');
|
|
1078
|
+
$mol_assert_equal($.$mol_tree2_from_string('a b\n')
|
|
1079
|
+
.insert($mol_tree2.struct('x'), null, null, null, null)
|
|
1080
|
+
.toString(), 'a b \\\n\tx\n');
|
|
1081
|
+
},
|
|
1082
|
+
'deleting'($) {
|
|
1083
|
+
$mol_assert_equal($.$mol_tree2_from_string('a b c d\n')
|
|
1084
|
+
.insert(null, 'a', 'b', 'c')
|
|
1085
|
+
.toString(), 'a b\n');
|
|
1086
|
+
$mol_assert_equal($.$mol_tree2_from_string('a b c d\n')
|
|
1087
|
+
.insert(null, 0, 0, 0)
|
|
1088
|
+
.toString(), 'a b\n');
|
|
1089
|
+
},
|
|
1090
|
+
'hack'($) {
|
|
1091
|
+
const res = $.$mol_tree2_from_string(`foo bar xxx\n`)
|
|
1092
|
+
.hack({
|
|
1093
|
+
'bar': (input, belt) => [input.struct('777', input.hack(belt))],
|
|
1094
|
+
});
|
|
1095
|
+
$mol_assert_equal(res.toString(), 'foo 777 xxx\n');
|
|
1096
|
+
},
|
|
1097
|
+
});
|
|
1098
|
+
})($ || ($ = {}));
|
|
1099
|
+
//mol/tree2/tree2.test.ts
|
|
1100
|
+
;
|
|
1101
|
+
"use strict";
|
|
1102
|
+
var $;
|
|
1103
|
+
(function ($) {
|
|
1104
|
+
$mol_test({
|
|
1105
|
+
'fromJSON'() {
|
|
1106
|
+
$mol_assert_equal($mol_tree2_from_json([]).toString(), '/\n');
|
|
1107
|
+
$mol_assert_equal($mol_tree2_from_json([false, true]).toString(), '/\n\tfalse\n\ttrue\n');
|
|
1108
|
+
$mol_assert_equal($mol_tree2_from_json([0, 1, 2.3]).toString(), '/\n\t0\n\t1\n\t2.3\n');
|
|
1109
|
+
$mol_assert_equal($mol_tree2_from_json(['', 'foo', 'bar\nbaz']).toString(), '/\n\t\\\n\t\\foo\n\t\\\n\t\t\\bar\n\t\t\\baz\n');
|
|
1110
|
+
$mol_assert_equal($mol_tree2_from_json({ 'foo': false, 'bar\nbaz': 'lol' }).toString(), '*\n\tfoo false\n\t\\\n\t\t\\bar\n\t\t\\baz\n\t\t\\lol\n');
|
|
1111
|
+
},
|
|
1112
|
+
});
|
|
1113
|
+
})($ || ($ = {}));
|
|
1114
|
+
//mol/tree2/from/json/json.test.ts
|
|
1115
|
+
;
|
|
1116
|
+
"use strict";
|
|
1117
|
+
//mol/type/unary/unary.ts
|
|
1118
|
+
;
|
|
1119
|
+
"use strict";
|
|
1120
|
+
//mol/type/param/param.test.ts
|
|
1121
|
+
;
|
|
1122
|
+
"use strict";
|
|
1123
|
+
//mol/type/param/param.ts
|
|
1124
|
+
;
|
|
1125
|
+
"use strict";
|
|
1126
|
+
//mol/type/tail/tail.test.ts
|
|
1127
|
+
;
|
|
1128
|
+
"use strict";
|
|
1129
|
+
//mol/type/tail/tail.ts
|
|
1130
|
+
;
|
|
1131
|
+
"use strict";
|
|
1132
|
+
//mol/data/value/value.ts
|
|
1146
1133
|
;
|
|
1147
1134
|
"use strict";
|
|
1148
1135
|
var $;
|
|
@@ -1159,12 +1146,15 @@ var $;
|
|
|
1159
1146
|
"use strict";
|
|
1160
1147
|
var $;
|
|
1161
1148
|
(function ($) {
|
|
1162
|
-
function $
|
|
1163
|
-
return Object.
|
|
1149
|
+
function $mol_data_setup(value, config) {
|
|
1150
|
+
return Object.assign(value, {
|
|
1151
|
+
config,
|
|
1152
|
+
Value: null
|
|
1153
|
+
});
|
|
1164
1154
|
}
|
|
1165
|
-
$.$
|
|
1155
|
+
$.$mol_data_setup = $mol_data_setup;
|
|
1166
1156
|
})($ || ($ = {}));
|
|
1167
|
-
//mol/
|
|
1157
|
+
//mol/data/setup/setup.ts
|
|
1168
1158
|
;
|
|
1169
1159
|
"use strict";
|
|
1170
1160
|
var $;
|
|
@@ -1195,31 +1185,26 @@ var $;
|
|
|
1195
1185
|
//mol/func/is/class/class.test.ts
|
|
1196
1186
|
;
|
|
1197
1187
|
"use strict";
|
|
1198
|
-
|
|
1188
|
+
var $;
|
|
1189
|
+
(function ($) {
|
|
1190
|
+
function $mol_func_is_class(func) {
|
|
1191
|
+
return Object.getOwnPropertyDescriptor(func, 'prototype')?.writable === false;
|
|
1192
|
+
}
|
|
1193
|
+
$.$mol_func_is_class = $mol_func_is_class;
|
|
1194
|
+
})($ || ($ = {}));
|
|
1195
|
+
//mol/func/is/class/class.ts
|
|
1199
1196
|
;
|
|
1200
1197
|
"use strict";
|
|
1201
1198
|
//mol/type/result/result.test.ts
|
|
1202
1199
|
;
|
|
1203
1200
|
"use strict";
|
|
1204
|
-
//mol/type/
|
|
1201
|
+
//mol/type/result/result.ts
|
|
1205
1202
|
;
|
|
1206
1203
|
"use strict";
|
|
1207
1204
|
//mol/type/foot/foot.test.ts
|
|
1208
1205
|
;
|
|
1209
1206
|
"use strict";
|
|
1210
|
-
|
|
1211
|
-
(function ($) {
|
|
1212
|
-
function $mol_data_pipe(...funcs) {
|
|
1213
|
-
return $mol_data_setup(function (input) {
|
|
1214
|
-
let value = input;
|
|
1215
|
-
for (const func of funcs)
|
|
1216
|
-
value = $mol_func_is_class(func) ? new func(value) : func.call(this, value);
|
|
1217
|
-
return value;
|
|
1218
|
-
}, { funcs });
|
|
1219
|
-
}
|
|
1220
|
-
$.$mol_data_pipe = $mol_data_pipe;
|
|
1221
|
-
})($ || ($ = {}));
|
|
1222
|
-
//mol/data/pipe/pipe.ts
|
|
1207
|
+
//mol/type/foot/foot.ts
|
|
1223
1208
|
;
|
|
1224
1209
|
"use strict";
|
|
1225
1210
|
var $;
|
|
@@ -1255,6 +1240,21 @@ var $;
|
|
|
1255
1240
|
;
|
|
1256
1241
|
"use strict";
|
|
1257
1242
|
var $;
|
|
1243
|
+
(function ($) {
|
|
1244
|
+
function $mol_data_pipe(...funcs) {
|
|
1245
|
+
return $mol_data_setup(function (input) {
|
|
1246
|
+
let value = input;
|
|
1247
|
+
for (const func of funcs)
|
|
1248
|
+
value = $mol_func_is_class(func) ? new func(value) : func.call(this, value);
|
|
1249
|
+
return value;
|
|
1250
|
+
}, { funcs });
|
|
1251
|
+
}
|
|
1252
|
+
$.$mol_data_pipe = $mol_data_pipe;
|
|
1253
|
+
})($ || ($ = {}));
|
|
1254
|
+
//mol/data/pipe/pipe.ts
|
|
1255
|
+
;
|
|
1256
|
+
"use strict";
|
|
1257
|
+
var $;
|
|
1258
1258
|
(function ($) {
|
|
1259
1259
|
const convert = $mol_data_pipe($mol_tree2_from_string, $mol_tree2_js_to_text, $mol_tree2_text_to_string);
|
|
1260
1260
|
$mol_test({
|