mol_db 0.0.573 → 0.0.574
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.deps.json +1 -1
- package/node.js +13 -13
- package/node.js.map +1 -1
- package/node.mjs +13 -13
- package/node.mjs.map +1 -1
- package/node.test.js +323 -323
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.deps.json +1 -1
- package/web.js +13 -13
- package/web.js.map +1 -1
- package/web.mjs +13 -13
- package/web.mjs.map +1 -1
- package/web.test.js +224 -224
- package/web.test.js.map +1 -1
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 $;
|
|
@@ -959,16 +959,6 @@ var $;
|
|
|
959
959
|
;
|
|
960
960
|
"use strict";
|
|
961
961
|
var $;
|
|
962
|
-
(function ($) {
|
|
963
|
-
function $mol_test_complete() {
|
|
964
|
-
process.exit(0);
|
|
965
|
-
}
|
|
966
|
-
$.$mol_test_complete = $mol_test_complete;
|
|
967
|
-
})($ || ($ = {}));
|
|
968
|
-
//mol/test/test.node.test.ts
|
|
969
|
-
;
|
|
970
|
-
"use strict";
|
|
971
|
-
var $;
|
|
972
962
|
(function ($_1) {
|
|
973
963
|
function $mol_test(set) {
|
|
974
964
|
for (let name in set) {
|
|
@@ -1056,17 +1046,13 @@ var $;
|
|
|
1056
1046
|
;
|
|
1057
1047
|
"use strict";
|
|
1058
1048
|
var $;
|
|
1059
|
-
(function ($
|
|
1060
|
-
$
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
$.$mol_log3_warn = () => { };
|
|
1065
|
-
$.$mol_log3_rise = () => { };
|
|
1066
|
-
$.$mol_log3_area = () => () => { };
|
|
1067
|
-
});
|
|
1049
|
+
(function ($) {
|
|
1050
|
+
function $mol_test_complete() {
|
|
1051
|
+
process.exit(0);
|
|
1052
|
+
}
|
|
1053
|
+
$.$mol_test_complete = $mol_test_complete;
|
|
1068
1054
|
})($ || ($ = {}));
|
|
1069
|
-
//mol/
|
|
1055
|
+
//mol/test/test.node.test.ts
|
|
1070
1056
|
;
|
|
1071
1057
|
"use strict";
|
|
1072
1058
|
var $;
|
|
@@ -1127,112 +1113,16 @@ var $;
|
|
|
1127
1113
|
//mol/type/error/error.ts
|
|
1128
1114
|
;
|
|
1129
1115
|
"use strict";
|
|
1130
|
-
//mol/type/assert/assert.test.ts
|
|
1131
|
-
;
|
|
1132
|
-
"use strict";
|
|
1133
1116
|
//mol/type/assert/assert.ts
|
|
1134
1117
|
;
|
|
1135
1118
|
"use strict";
|
|
1136
|
-
//mol/type/
|
|
1137
|
-
;
|
|
1138
|
-
"use strict";
|
|
1139
|
-
//mol/type/equals/equals.ts
|
|
1140
|
-
;
|
|
1141
|
-
"use strict";
|
|
1142
|
-
//mol/type/partial/deep/deep.test.ts
|
|
1119
|
+
//mol/type/assert/assert.test.ts
|
|
1143
1120
|
;
|
|
1144
1121
|
"use strict";
|
|
1145
1122
|
//mol/type/partial/deep/deep.ts
|
|
1146
1123
|
;
|
|
1147
1124
|
"use strict";
|
|
1148
|
-
|
|
1149
|
-
(function ($) {
|
|
1150
|
-
$mol_test({
|
|
1151
|
-
'Make empty div'() {
|
|
1152
|
-
$mol_assert_equal(($mol_jsx("div", null)).outerHTML, '<div></div>');
|
|
1153
|
-
},
|
|
1154
|
-
'Define native field'() {
|
|
1155
|
-
const dom = $mol_jsx("input", { value: '123' });
|
|
1156
|
-
$mol_assert_equal(dom.outerHTML, '<input value="123">');
|
|
1157
|
-
$mol_assert_equal(dom.value, '123');
|
|
1158
|
-
},
|
|
1159
|
-
'Define classes'() {
|
|
1160
|
-
const dom = $mol_jsx("div", { class: 'foo bar' });
|
|
1161
|
-
$mol_assert_equal(dom.outerHTML, '<div class="foo bar"></div>');
|
|
1162
|
-
},
|
|
1163
|
-
'Define styles'() {
|
|
1164
|
-
const dom = $mol_jsx("div", { style: { color: 'red' } });
|
|
1165
|
-
$mol_assert_equal(dom.outerHTML, '<div style="color: red;"></div>');
|
|
1166
|
-
},
|
|
1167
|
-
'Define dataset'() {
|
|
1168
|
-
const dom = $mol_jsx("div", { dataset: { foo: 'bar' } });
|
|
1169
|
-
$mol_assert_equal(dom.outerHTML, '<div data-foo="bar"></div>');
|
|
1170
|
-
},
|
|
1171
|
-
'Define attributes'() {
|
|
1172
|
-
const dom = $mol_jsx("div", { lang: "ru", hidden: true });
|
|
1173
|
-
$mol_assert_equal(dom.outerHTML, '<div lang="ru" hidden=""></div>');
|
|
1174
|
-
},
|
|
1175
|
-
'Define child nodes'() {
|
|
1176
|
-
const dom = $mol_jsx("div", null,
|
|
1177
|
-
"hello",
|
|
1178
|
-
$mol_jsx("strong", null, "world"),
|
|
1179
|
-
"!");
|
|
1180
|
-
$mol_assert_equal(dom.outerHTML, '<div>hello<strong>world</strong>!</div>');
|
|
1181
|
-
},
|
|
1182
|
-
'Function as component'() {
|
|
1183
|
-
const Button = (props, target) => {
|
|
1184
|
-
return $mol_jsx("button", { title: props.hint }, target());
|
|
1185
|
-
};
|
|
1186
|
-
const dom = $mol_jsx(Button, { id: "foo", hint: "click me" }, () => 'hey!');
|
|
1187
|
-
$mol_assert_equal(dom.outerHTML, '<button id="foo" title="click me" class="Button">hey!</button>');
|
|
1188
|
-
},
|
|
1189
|
-
'Nested guid generation'() {
|
|
1190
|
-
const Foo = () => {
|
|
1191
|
-
return $mol_jsx("div", null,
|
|
1192
|
-
$mol_jsx(Bar, { id: "bar" },
|
|
1193
|
-
$mol_jsx("img", { id: "icon" })));
|
|
1194
|
-
};
|
|
1195
|
-
const Bar = (props, icon) => {
|
|
1196
|
-
return $mol_jsx("span", null,
|
|
1197
|
-
icon,
|
|
1198
|
-
$mol_jsx("i", { id: "label" }));
|
|
1199
|
-
};
|
|
1200
|
-
const dom = $mol_jsx(Foo, { id: "foo" });
|
|
1201
|
-
$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>');
|
|
1202
|
-
},
|
|
1203
|
-
'Fail on non unique ids'() {
|
|
1204
|
-
const App = () => {
|
|
1205
|
-
return $mol_jsx("div", null,
|
|
1206
|
-
$mol_jsx("span", { id: "bar" }),
|
|
1207
|
-
$mol_jsx("span", { id: "bar" }));
|
|
1208
|
-
};
|
|
1209
|
-
$mol_assert_fail(() => $mol_jsx(App, { id: "foo" }), 'JSX already has tag with id "foo/bar"');
|
|
1210
|
-
},
|
|
1211
|
-
'Owner based guid generationn'() {
|
|
1212
|
-
const Foo = () => {
|
|
1213
|
-
return $mol_jsx("div", null,
|
|
1214
|
-
$mol_jsx(Bar, { id: "middle", icon: () => $mol_jsx("img", { id: "icon" }) }));
|
|
1215
|
-
};
|
|
1216
|
-
const Bar = (props) => {
|
|
1217
|
-
return $mol_jsx("span", null, props.icon());
|
|
1218
|
-
};
|
|
1219
|
-
const dom = $mol_jsx(Foo, { id: "app" });
|
|
1220
|
-
$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>');
|
|
1221
|
-
},
|
|
1222
|
-
'Fail on same ids from different caller'() {
|
|
1223
|
-
const Foo = () => {
|
|
1224
|
-
return $mol_jsx("div", null,
|
|
1225
|
-
$mol_jsx("img", { id: "icon" }),
|
|
1226
|
-
$mol_jsx(Bar, { id: "bar", icon: () => $mol_jsx("img", { id: "icon" }) }));
|
|
1227
|
-
};
|
|
1228
|
-
const Bar = (props) => {
|
|
1229
|
-
return $mol_jsx("span", null, props.icon());
|
|
1230
|
-
};
|
|
1231
|
-
$mol_assert_fail(() => $mol_jsx(Foo, { id: "foo" }), 'JSX already has tag with id "foo/icon"');
|
|
1232
|
-
},
|
|
1233
|
-
});
|
|
1234
|
-
})($ || ($ = {}));
|
|
1235
|
-
//mol/jsx/jsx.test.tsx
|
|
1125
|
+
//mol/type/partial/deep/deep.test.ts
|
|
1236
1126
|
;
|
|
1237
1127
|
"use strict";
|
|
1238
1128
|
var $;
|
|
@@ -1359,97 +1249,91 @@ var $;
|
|
|
1359
1249
|
var $;
|
|
1360
1250
|
(function ($) {
|
|
1361
1251
|
$mol_test({
|
|
1362
|
-
'
|
|
1363
|
-
$
|
|
1364
|
-
$mol_assert_ok($mol_compare_deep(undefined, undefined));
|
|
1365
|
-
$mol_assert_not($mol_compare_deep(undefined, null));
|
|
1366
|
-
$mol_assert_not($mol_compare_deep({}, null));
|
|
1367
|
-
},
|
|
1368
|
-
'number'() {
|
|
1369
|
-
$mol_assert_ok($mol_compare_deep(1, 1));
|
|
1370
|
-
$mol_assert_ok($mol_compare_deep(Number.NaN, Number.NaN));
|
|
1371
|
-
$mol_assert_not($mol_compare_deep(1, 2));
|
|
1372
|
-
$mol_assert_ok($mol_compare_deep(Object(1), Object(1)));
|
|
1373
|
-
$mol_assert_not($mol_compare_deep(Object(1), Object(2)));
|
|
1374
|
-
},
|
|
1375
|
-
'POJO'() {
|
|
1376
|
-
$mol_assert_ok($mol_compare_deep({}, {}));
|
|
1377
|
-
$mol_assert_not($mol_compare_deep({ a: 1 }, { b: 2 }));
|
|
1378
|
-
$mol_assert_not($mol_compare_deep({ a: 1 }, { a: 2 }));
|
|
1379
|
-
$mol_assert_not($mol_compare_deep({}, { a: undefined }));
|
|
1380
|
-
$mol_assert_ok($mol_compare_deep({ a: 1, b: 2 }, { b: 2, a: 1 }));
|
|
1381
|
-
$mol_assert_ok($mol_compare_deep({ a: { b: 1 } }, { a: { b: 1 } }));
|
|
1252
|
+
'Make empty div'() {
|
|
1253
|
+
$mol_assert_equal(($mol_jsx("div", null)).outerHTML, '<div></div>');
|
|
1382
1254
|
},
|
|
1383
|
-
'
|
|
1384
|
-
$
|
|
1385
|
-
$
|
|
1386
|
-
$
|
|
1387
|
-
$mol_assert_not($mol_compare_deep([1, 2,], [1, 3, undefined]));
|
|
1255
|
+
'Define native field'() {
|
|
1256
|
+
const dom = $mol_jsx("input", { value: '123' });
|
|
1257
|
+
$mol_assert_equal(dom.outerHTML, '<input value="123">');
|
|
1258
|
+
$mol_assert_equal(dom.value, '123');
|
|
1388
1259
|
},
|
|
1389
|
-
'
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
$mol_assert_not($mol_compare_deep(new Thing, new Thing));
|
|
1393
|
-
$mol_assert_not($mol_compare_deep(() => 1, () => 1));
|
|
1394
|
-
$mol_assert_not($mol_compare_deep(new RangeError('Test error'), new RangeError('Test error')));
|
|
1260
|
+
'Define classes'() {
|
|
1261
|
+
const dom = $mol_jsx("div", { class: 'foo bar' });
|
|
1262
|
+
$mol_assert_equal(dom.outerHTML, '<div class="foo bar"></div>');
|
|
1395
1263
|
},
|
|
1396
|
-
'
|
|
1397
|
-
const
|
|
1398
|
-
|
|
1399
|
-
const b = { foo: {} };
|
|
1400
|
-
b['self'] = b;
|
|
1401
|
-
$mol_assert_ok($mol_compare_deep(a, b));
|
|
1264
|
+
'Define styles'() {
|
|
1265
|
+
const dom = $mol_jsx("div", { style: { color: 'red' } });
|
|
1266
|
+
$mol_assert_equal(dom.outerHTML, '<div style="color: red;"></div>');
|
|
1402
1267
|
},
|
|
1403
|
-
'
|
|
1404
|
-
$
|
|
1405
|
-
$
|
|
1268
|
+
'Define dataset'() {
|
|
1269
|
+
const dom = $mol_jsx("div", { dataset: { foo: 'bar' } });
|
|
1270
|
+
$mol_assert_equal(dom.outerHTML, '<div data-foo="bar"></div>');
|
|
1406
1271
|
},
|
|
1407
|
-
'
|
|
1408
|
-
$
|
|
1409
|
-
$
|
|
1410
|
-
$mol_assert_not($mol_compare_deep(/\x22/mig, /\x22/mg));
|
|
1272
|
+
'Define attributes'() {
|
|
1273
|
+
const dom = $mol_jsx("div", { lang: "ru", hidden: true });
|
|
1274
|
+
$mol_assert_equal(dom.outerHTML, '<div lang="ru" hidden=""></div>');
|
|
1411
1275
|
},
|
|
1412
|
-
'
|
|
1413
|
-
$
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1276
|
+
'Define child nodes'() {
|
|
1277
|
+
const dom = $mol_jsx("div", null,
|
|
1278
|
+
"hello",
|
|
1279
|
+
$mol_jsx("strong", null, "world"),
|
|
1280
|
+
"!");
|
|
1281
|
+
$mol_assert_equal(dom.outerHTML, '<div>hello<strong>world</strong>!</div>');
|
|
1417
1282
|
},
|
|
1418
|
-
'
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
$
|
|
1423
|
-
$
|
|
1283
|
+
'Function as component'() {
|
|
1284
|
+
const Button = (props, target) => {
|
|
1285
|
+
return $mol_jsx("button", { title: props.hint }, target());
|
|
1286
|
+
};
|
|
1287
|
+
const dom = $mol_jsx(Button, { id: "foo", hint: "click me" }, () => 'hey!');
|
|
1288
|
+
$mol_assert_equal(dom.outerHTML, '<button id="foo" title="click me" class="Button">hey!</button>');
|
|
1424
1289
|
},
|
|
1425
|
-
'
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1290
|
+
'Nested guid generation'() {
|
|
1291
|
+
const Foo = () => {
|
|
1292
|
+
return $mol_jsx("div", null,
|
|
1293
|
+
$mol_jsx(Bar, { id: "bar" },
|
|
1294
|
+
$mol_jsx("img", { id: "icon" })));
|
|
1295
|
+
};
|
|
1296
|
+
const Bar = (props, icon) => {
|
|
1297
|
+
return $mol_jsx("span", null,
|
|
1298
|
+
icon,
|
|
1299
|
+
$mol_jsx("i", { id: "label" }));
|
|
1300
|
+
};
|
|
1301
|
+
const dom = $mol_jsx(Foo, { id: "foo" });
|
|
1302
|
+
$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>');
|
|
1429
1303
|
},
|
|
1430
|
-
'
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1304
|
+
'Fail on non unique ids'() {
|
|
1305
|
+
const App = () => {
|
|
1306
|
+
return $mol_jsx("div", null,
|
|
1307
|
+
$mol_jsx("span", { id: "bar" }),
|
|
1308
|
+
$mol_jsx("span", { id: "bar" }));
|
|
1309
|
+
};
|
|
1310
|
+
$mol_assert_fail(() => $mol_jsx(App, { id: "foo" }), 'JSX already has tag with id "foo/bar"');
|
|
1434
1311
|
},
|
|
1435
|
-
'
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1312
|
+
'Owner based guid generationn'() {
|
|
1313
|
+
const Foo = () => {
|
|
1314
|
+
return $mol_jsx("div", null,
|
|
1315
|
+
$mol_jsx(Bar, { id: "middle", icon: () => $mol_jsx("img", { id: "icon" }) }));
|
|
1316
|
+
};
|
|
1317
|
+
const Bar = (props) => {
|
|
1318
|
+
return $mol_jsx("span", null, props.icon());
|
|
1319
|
+
};
|
|
1320
|
+
const dom = $mol_jsx(Foo, { id: "app" });
|
|
1321
|
+
$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>');
|
|
1322
|
+
},
|
|
1323
|
+
'Fail on same ids from different caller'() {
|
|
1324
|
+
const Foo = () => {
|
|
1325
|
+
return $mol_jsx("div", null,
|
|
1326
|
+
$mol_jsx("img", { id: "icon" }),
|
|
1327
|
+
$mol_jsx(Bar, { id: "bar", icon: () => $mol_jsx("img", { id: "icon" }) }));
|
|
1328
|
+
};
|
|
1329
|
+
const Bar = (props) => {
|
|
1330
|
+
return $mol_jsx("span", null, props.icon());
|
|
1331
|
+
};
|
|
1332
|
+
$mol_assert_fail(() => $mol_jsx(Foo, { id: "foo" }), 'JSX already has tag with id "foo/icon"');
|
|
1449
1333
|
},
|
|
1450
1334
|
});
|
|
1451
1335
|
})($ || ($ = {}));
|
|
1452
|
-
//mol/
|
|
1336
|
+
//mol/jsx/jsx.test.tsx
|
|
1453
1337
|
;
|
|
1454
1338
|
"use strict";
|
|
1455
1339
|
var $;
|
|
@@ -1578,46 +1462,110 @@ var $;
|
|
|
1578
1462
|
;
|
|
1579
1463
|
"use strict";
|
|
1580
1464
|
var $;
|
|
1581
|
-
(function ($) {
|
|
1582
|
-
function $mol_dom_serialize(node) {
|
|
1583
|
-
const serializer = new $mol_dom_context.XMLSerializer;
|
|
1584
|
-
return serializer.serializeToString(node);
|
|
1585
|
-
}
|
|
1586
|
-
$.$mol_dom_serialize = $mol_dom_serialize;
|
|
1587
|
-
})($ || ($ = {}));
|
|
1588
|
-
//mol/dom/serialize/serialize.ts
|
|
1589
|
-
;
|
|
1590
|
-
"use strict";
|
|
1591
|
-
var $;
|
|
1592
1465
|
(function ($) {
|
|
1593
1466
|
$mol_test({
|
|
1594
|
-
'
|
|
1595
|
-
$
|
|
1467
|
+
'nulls & undefineds'() {
|
|
1468
|
+
$mol_assert_ok($mol_compare_deep(null, null));
|
|
1469
|
+
$mol_assert_ok($mol_compare_deep(undefined, undefined));
|
|
1470
|
+
$mol_assert_not($mol_compare_deep(undefined, null));
|
|
1471
|
+
$mol_assert_not($mol_compare_deep({}, null));
|
|
1596
1472
|
},
|
|
1597
|
-
'
|
|
1598
|
-
$mol_assert_ok(1);
|
|
1473
|
+
'number'() {
|
|
1474
|
+
$mol_assert_ok($mol_compare_deep(1, 1));
|
|
1475
|
+
$mol_assert_ok($mol_compare_deep(Number.NaN, Number.NaN));
|
|
1476
|
+
$mol_assert_not($mol_compare_deep(1, 2));
|
|
1477
|
+
$mol_assert_ok($mol_compare_deep(Object(1), Object(1)));
|
|
1478
|
+
$mol_assert_not($mol_compare_deep(Object(1), Object(2)));
|
|
1599
1479
|
},
|
|
1600
|
-
'
|
|
1601
|
-
$
|
|
1480
|
+
'POJO'() {
|
|
1481
|
+
$mol_assert_ok($mol_compare_deep({}, {}));
|
|
1482
|
+
$mol_assert_not($mol_compare_deep({ a: 1 }, { b: 2 }));
|
|
1483
|
+
$mol_assert_not($mol_compare_deep({ a: 1 }, { a: 2 }));
|
|
1484
|
+
$mol_assert_not($mol_compare_deep({}, { a: undefined }));
|
|
1485
|
+
$mol_assert_ok($mol_compare_deep({ a: 1, b: 2 }, { b: 2, a: 1 }));
|
|
1486
|
+
$mol_assert_ok($mol_compare_deep({ a: { b: 1 } }, { a: { b: 1 } }));
|
|
1602
1487
|
},
|
|
1603
|
-
'
|
|
1604
|
-
$
|
|
1488
|
+
'Array'() {
|
|
1489
|
+
$mol_assert_ok($mol_compare_deep([], []));
|
|
1490
|
+
$mol_assert_ok($mol_compare_deep([1, [2]], [1, [2]]));
|
|
1491
|
+
$mol_assert_not($mol_compare_deep([1, 2], [1, 3]));
|
|
1492
|
+
$mol_assert_not($mol_compare_deep([1, 2,], [1, 3, undefined]));
|
|
1605
1493
|
},
|
|
1606
|
-
'
|
|
1607
|
-
|
|
1494
|
+
'Non POJO are different'() {
|
|
1495
|
+
class Thing extends Object {
|
|
1496
|
+
}
|
|
1497
|
+
$mol_assert_not($mol_compare_deep(new Thing, new Thing));
|
|
1498
|
+
$mol_assert_not($mol_compare_deep(() => 1, () => 1));
|
|
1499
|
+
$mol_assert_not($mol_compare_deep(new RangeError('Test error'), new RangeError('Test error')));
|
|
1608
1500
|
},
|
|
1609
|
-
'
|
|
1610
|
-
|
|
1501
|
+
'same POJOs with cyclic reference'() {
|
|
1502
|
+
const a = { foo: {} };
|
|
1503
|
+
a['self'] = a;
|
|
1504
|
+
const b = { foo: {} };
|
|
1505
|
+
b['self'] = b;
|
|
1506
|
+
$mol_assert_ok($mol_compare_deep(a, b));
|
|
1611
1507
|
},
|
|
1612
|
-
'
|
|
1613
|
-
$
|
|
1508
|
+
'Date'() {
|
|
1509
|
+
$mol_assert_ok($mol_compare_deep(new Date(12345), new Date(12345)));
|
|
1510
|
+
$mol_assert_not($mol_compare_deep(new Date(12345), new Date(12346)));
|
|
1614
1511
|
},
|
|
1615
|
-
'
|
|
1616
|
-
$
|
|
1512
|
+
'RegExp'() {
|
|
1513
|
+
$mol_assert_ok($mol_compare_deep(/\x22/mig, /\x22/mig));
|
|
1514
|
+
$mol_assert_not($mol_compare_deep(/\x22/mig, /\x21/mig));
|
|
1515
|
+
$mol_assert_not($mol_compare_deep(/\x22/mig, /\x22/mg));
|
|
1516
|
+
},
|
|
1517
|
+
'Error'() {
|
|
1518
|
+
$mol_assert_not($mol_compare_deep(new Error('xxx'), new Error('xxx')));
|
|
1519
|
+
const fail = (message) => new Error(message);
|
|
1520
|
+
$mol_assert_ok($mol_compare_deep(...['xxx', 'xxx'].map(msg => new Error(msg))));
|
|
1521
|
+
$mol_assert_not($mol_compare_deep(...['xxx', 'yyy'].map(msg => new Error(msg))));
|
|
1522
|
+
},
|
|
1523
|
+
'Map'() {
|
|
1524
|
+
$mol_assert_ok($mol_compare_deep(new Map, new Map));
|
|
1525
|
+
$mol_assert_ok($mol_compare_deep(new Map([[1, [2]]]), new Map([[1, [2]]])));
|
|
1526
|
+
$mol_assert_ok($mol_compare_deep(new Map([[[1], 2]]), new Map([[[1], 2]])));
|
|
1527
|
+
$mol_assert_not($mol_compare_deep(new Map([[1, 2]]), new Map([[1, 3]])));
|
|
1528
|
+
$mol_assert_not($mol_compare_deep(new Map([[[1], 2]]), new Map([[[3], 2]])));
|
|
1529
|
+
},
|
|
1530
|
+
'Set'() {
|
|
1531
|
+
$mol_assert_ok($mol_compare_deep(new Set, new Set));
|
|
1532
|
+
$mol_assert_ok($mol_compare_deep(new Set([1, [2]]), new Set([1, [2]])));
|
|
1533
|
+
$mol_assert_not($mol_compare_deep(new Set([1]), new Set([2])));
|
|
1534
|
+
},
|
|
1535
|
+
'Uint8Array'() {
|
|
1536
|
+
$mol_assert_ok($mol_compare_deep(new Uint8Array, new Uint8Array));
|
|
1537
|
+
$mol_assert_ok($mol_compare_deep(new Uint8Array([0]), new Uint8Array([0])));
|
|
1538
|
+
$mol_assert_not($mol_compare_deep(new Uint8Array([0]), new Uint8Array([1])));
|
|
1539
|
+
},
|
|
1540
|
+
'Custom comparator'() {
|
|
1541
|
+
class User {
|
|
1542
|
+
name;
|
|
1543
|
+
rand;
|
|
1544
|
+
constructor(name, rand = Math.random()) {
|
|
1545
|
+
this.name = name;
|
|
1546
|
+
this.rand = rand;
|
|
1547
|
+
}
|
|
1548
|
+
[Symbol.toPrimitive](mode) {
|
|
1549
|
+
return this.name;
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
$mol_assert_ok($mol_compare_deep(new User('Jin'), new User('Jin')));
|
|
1553
|
+
$mol_assert_not($mol_compare_deep(new User('Jin'), new User('John')));
|
|
1617
1554
|
},
|
|
1618
1555
|
});
|
|
1619
1556
|
})($ || ($ = {}));
|
|
1620
|
-
//mol/
|
|
1557
|
+
//mol/compare/deep/deep.test.tsx
|
|
1558
|
+
;
|
|
1559
|
+
"use strict";
|
|
1560
|
+
var $;
|
|
1561
|
+
(function ($) {
|
|
1562
|
+
function $mol_dom_serialize(node) {
|
|
1563
|
+
const serializer = new $mol_dom_context.XMLSerializer;
|
|
1564
|
+
return serializer.serializeToString(node);
|
|
1565
|
+
}
|
|
1566
|
+
$.$mol_dom_serialize = $mol_dom_serialize;
|
|
1567
|
+
})($ || ($ = {}));
|
|
1568
|
+
//mol/dom/serialize/serialize.ts
|
|
1621
1569
|
;
|
|
1622
1570
|
"use strict";
|
|
1623
1571
|
var $;
|
|
@@ -1715,6 +1663,112 @@ var $;
|
|
|
1715
1663
|
;
|
|
1716
1664
|
"use strict";
|
|
1717
1665
|
var $;
|
|
1666
|
+
(function ($) {
|
|
1667
|
+
$mol_test({
|
|
1668
|
+
'must be false'() {
|
|
1669
|
+
$mol_assert_not(0);
|
|
1670
|
+
},
|
|
1671
|
+
'must be true'() {
|
|
1672
|
+
$mol_assert_ok(1);
|
|
1673
|
+
},
|
|
1674
|
+
'two must be equal'() {
|
|
1675
|
+
$mol_assert_equal(2, 2);
|
|
1676
|
+
},
|
|
1677
|
+
'three must be equal'() {
|
|
1678
|
+
$mol_assert_equal(2, 2, 2);
|
|
1679
|
+
},
|
|
1680
|
+
'two must be unique'() {
|
|
1681
|
+
$mol_assert_unique([3], [3]);
|
|
1682
|
+
},
|
|
1683
|
+
'three must be unique'() {
|
|
1684
|
+
$mol_assert_unique([3], [3], [3]);
|
|
1685
|
+
},
|
|
1686
|
+
'two must be alike'() {
|
|
1687
|
+
$mol_assert_like([3], [3]);
|
|
1688
|
+
},
|
|
1689
|
+
'three must be alike'() {
|
|
1690
|
+
$mol_assert_like([3], [3], [3]);
|
|
1691
|
+
},
|
|
1692
|
+
});
|
|
1693
|
+
})($ || ($ = {}));
|
|
1694
|
+
//mol/assert/assert.test.ts
|
|
1695
|
+
;
|
|
1696
|
+
"use strict";
|
|
1697
|
+
var $;
|
|
1698
|
+
(function ($) {
|
|
1699
|
+
$mol_test({
|
|
1700
|
+
async 'put, get, drop, count records and clear store'() {
|
|
1701
|
+
const db = await $$.$mol_db('$mol_db_test', mig => mig.store_make('letters'));
|
|
1702
|
+
const trans = db.change('letters');
|
|
1703
|
+
try {
|
|
1704
|
+
const { letters } = trans.stores;
|
|
1705
|
+
$mol_assert_like(await letters.get(1), undefined);
|
|
1706
|
+
$mol_assert_like(await letters.get(2), undefined);
|
|
1707
|
+
$mol_assert_like(await letters.count(), 0);
|
|
1708
|
+
await letters.put('a');
|
|
1709
|
+
await letters.put('b', 1);
|
|
1710
|
+
await letters.put('c', 2);
|
|
1711
|
+
$mol_assert_like(await letters.get(1), 'b');
|
|
1712
|
+
$mol_assert_like(await letters.get(2), 'c');
|
|
1713
|
+
$mol_assert_like(await letters.count(), 2);
|
|
1714
|
+
await letters.drop(1);
|
|
1715
|
+
$mol_assert_like(await letters.get(1), undefined);
|
|
1716
|
+
$mol_assert_like(await letters.count(), 1);
|
|
1717
|
+
await letters.clear();
|
|
1718
|
+
$mol_assert_like(await letters.count(), 0);
|
|
1719
|
+
}
|
|
1720
|
+
finally {
|
|
1721
|
+
trans.abort();
|
|
1722
|
+
db.kill();
|
|
1723
|
+
}
|
|
1724
|
+
},
|
|
1725
|
+
async 'select by query'() {
|
|
1726
|
+
const db = await $$.$mol_db('$mol_db_test', mig => mig.store_make('letters'));
|
|
1727
|
+
const trans = db.change('letters');
|
|
1728
|
+
try {
|
|
1729
|
+
const { letters } = trans.stores;
|
|
1730
|
+
await letters.put('a');
|
|
1731
|
+
await letters.put('b');
|
|
1732
|
+
await letters.put('c');
|
|
1733
|
+
await letters.put('d');
|
|
1734
|
+
$mol_assert_like(await letters.select(), ['a', 'b', 'c', 'd']);
|
|
1735
|
+
$mol_assert_like(await letters.select(null, 2), ['a', 'b']);
|
|
1736
|
+
$mol_assert_like(await letters.select($mol_dom_context.IDBKeyRange.bound(2, 3)), ['b', 'c']);
|
|
1737
|
+
}
|
|
1738
|
+
finally {
|
|
1739
|
+
trans.abort();
|
|
1740
|
+
db.kill();
|
|
1741
|
+
}
|
|
1742
|
+
},
|
|
1743
|
+
});
|
|
1744
|
+
})($ || ($ = {}));
|
|
1745
|
+
//mol/db/store/store.test.ts
|
|
1746
|
+
;
|
|
1747
|
+
"use strict";
|
|
1748
|
+
var $;
|
|
1749
|
+
(function ($_1) {
|
|
1750
|
+
$mol_test_mocks.push($ => {
|
|
1751
|
+
$.$mol_log3_come = () => { };
|
|
1752
|
+
$.$mol_log3_done = () => { };
|
|
1753
|
+
$.$mol_log3_fail = () => { };
|
|
1754
|
+
$.$mol_log3_warn = () => { };
|
|
1755
|
+
$.$mol_log3_rise = () => { };
|
|
1756
|
+
$.$mol_log3_area = () => () => { };
|
|
1757
|
+
});
|
|
1758
|
+
})($ || ($ = {}));
|
|
1759
|
+
//mol/log3/log3.test.ts
|
|
1760
|
+
;
|
|
1761
|
+
"use strict";
|
|
1762
|
+
//mol/type/equals/equals.ts
|
|
1763
|
+
;
|
|
1764
|
+
"use strict";
|
|
1765
|
+
//mol/type/equals/equals.test.ts
|
|
1766
|
+
;
|
|
1767
|
+
"use strict";
|
|
1768
|
+
//mol/type/writable/writable.test.ts
|
|
1769
|
+
;
|
|
1770
|
+
"use strict";
|
|
1771
|
+
var $;
|
|
1718
1772
|
(function ($) {
|
|
1719
1773
|
$mol_test({
|
|
1720
1774
|
'get'() {
|
|
@@ -1777,55 +1831,6 @@ var $;
|
|
|
1777
1831
|
//mol/delegate/delegate.test.ts
|
|
1778
1832
|
;
|
|
1779
1833
|
"use strict";
|
|
1780
|
-
//mol/type/writable/writable.test.ts
|
|
1781
|
-
;
|
|
1782
|
-
"use strict";
|
|
1783
|
-
var $;
|
|
1784
|
-
(function ($_1) {
|
|
1785
|
-
$mol_test({
|
|
1786
|
-
'FQN of anon function'($) {
|
|
1787
|
-
const $$ = Object.assign($, { $mol_func_name_test: (() => () => { })() });
|
|
1788
|
-
$mol_assert_equal($$.$mol_func_name_test.name, '');
|
|
1789
|
-
$mol_assert_equal($$.$mol_func_name($$.$mol_func_name_test), '$mol_func_name_test');
|
|
1790
|
-
$mol_assert_equal($$.$mol_func_name_test.name, '$mol_func_name_test');
|
|
1791
|
-
},
|
|
1792
|
-
});
|
|
1793
|
-
})($ || ($ = {}));
|
|
1794
|
-
//mol/func/name/name.test.ts
|
|
1795
|
-
;
|
|
1796
|
-
"use strict";
|
|
1797
|
-
var $;
|
|
1798
|
-
(function ($) {
|
|
1799
|
-
const named = new WeakSet();
|
|
1800
|
-
function $mol_func_name(func) {
|
|
1801
|
-
let name = func.name;
|
|
1802
|
-
if (name?.length > 1)
|
|
1803
|
-
return name;
|
|
1804
|
-
if (named.has(func))
|
|
1805
|
-
return name;
|
|
1806
|
-
for (let key in this) {
|
|
1807
|
-
try {
|
|
1808
|
-
if (this[key] !== func)
|
|
1809
|
-
continue;
|
|
1810
|
-
name = key;
|
|
1811
|
-
Object.defineProperty(func, 'name', { value: name });
|
|
1812
|
-
break;
|
|
1813
|
-
}
|
|
1814
|
-
catch { }
|
|
1815
|
-
}
|
|
1816
|
-
named.add(func);
|
|
1817
|
-
return name;
|
|
1818
|
-
}
|
|
1819
|
-
$.$mol_func_name = $mol_func_name;
|
|
1820
|
-
function $mol_func_name_from(target, source) {
|
|
1821
|
-
Object.defineProperty(target, 'name', { value: source.name });
|
|
1822
|
-
return target;
|
|
1823
|
-
}
|
|
1824
|
-
$.$mol_func_name_from = $mol_func_name_from;
|
|
1825
|
-
})($ || ($ = {}));
|
|
1826
|
-
//mol/func/name/name.ts
|
|
1827
|
-
;
|
|
1828
|
-
"use strict";
|
|
1829
1834
|
var $;
|
|
1830
1835
|
(function ($_1) {
|
|
1831
1836
|
$mol_test({
|
|
@@ -1888,53 +1893,48 @@ var $;
|
|
|
1888
1893
|
"use strict";
|
|
1889
1894
|
var $;
|
|
1890
1895
|
(function ($) {
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
$mol_assert_like(await letters.count(), 0);
|
|
1900
|
-
await letters.put('a');
|
|
1901
|
-
await letters.put('b', 1);
|
|
1902
|
-
await letters.put('c', 2);
|
|
1903
|
-
$mol_assert_like(await letters.get(1), 'b');
|
|
1904
|
-
$mol_assert_like(await letters.get(2), 'c');
|
|
1905
|
-
$mol_assert_like(await letters.count(), 2);
|
|
1906
|
-
await letters.drop(1);
|
|
1907
|
-
$mol_assert_like(await letters.get(1), undefined);
|
|
1908
|
-
$mol_assert_like(await letters.count(), 1);
|
|
1909
|
-
await letters.clear();
|
|
1910
|
-
$mol_assert_like(await letters.count(), 0);
|
|
1911
|
-
}
|
|
1912
|
-
finally {
|
|
1913
|
-
trans.abort();
|
|
1914
|
-
db.kill();
|
|
1915
|
-
}
|
|
1916
|
-
},
|
|
1917
|
-
async 'select by query'() {
|
|
1918
|
-
const db = await $$.$mol_db('$mol_db_test', mig => mig.store_make('letters'));
|
|
1919
|
-
const trans = db.change('letters');
|
|
1896
|
+
const named = new WeakSet();
|
|
1897
|
+
function $mol_func_name(func) {
|
|
1898
|
+
let name = func.name;
|
|
1899
|
+
if (name?.length > 1)
|
|
1900
|
+
return name;
|
|
1901
|
+
if (named.has(func))
|
|
1902
|
+
return name;
|
|
1903
|
+
for (let key in this) {
|
|
1920
1904
|
try {
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
$mol_assert_like(await letters.select(), ['a', 'b', 'c', 'd']);
|
|
1927
|
-
$mol_assert_like(await letters.select(null, 2), ['a', 'b']);
|
|
1928
|
-
$mol_assert_like(await letters.select($mol_dom_context.IDBKeyRange.bound(2, 3)), ['b', 'c']);
|
|
1929
|
-
}
|
|
1930
|
-
finally {
|
|
1931
|
-
trans.abort();
|
|
1932
|
-
db.kill();
|
|
1905
|
+
if (this[key] !== func)
|
|
1906
|
+
continue;
|
|
1907
|
+
name = key;
|
|
1908
|
+
Object.defineProperty(func, 'name', { value: name });
|
|
1909
|
+
break;
|
|
1933
1910
|
}
|
|
1911
|
+
catch { }
|
|
1912
|
+
}
|
|
1913
|
+
named.add(func);
|
|
1914
|
+
return name;
|
|
1915
|
+
}
|
|
1916
|
+
$.$mol_func_name = $mol_func_name;
|
|
1917
|
+
function $mol_func_name_from(target, source) {
|
|
1918
|
+
Object.defineProperty(target, 'name', { value: source.name });
|
|
1919
|
+
return target;
|
|
1920
|
+
}
|
|
1921
|
+
$.$mol_func_name_from = $mol_func_name_from;
|
|
1922
|
+
})($ || ($ = {}));
|
|
1923
|
+
//mol/func/name/name.ts
|
|
1924
|
+
;
|
|
1925
|
+
"use strict";
|
|
1926
|
+
var $;
|
|
1927
|
+
(function ($_1) {
|
|
1928
|
+
$mol_test({
|
|
1929
|
+
'FQN of anon function'($) {
|
|
1930
|
+
const $$ = Object.assign($, { $mol_func_name_test: (() => () => { })() });
|
|
1931
|
+
$mol_assert_equal($$.$mol_func_name_test.name, '');
|
|
1932
|
+
$mol_assert_equal($$.$mol_func_name($$.$mol_func_name_test), '$mol_func_name_test');
|
|
1933
|
+
$mol_assert_equal($$.$mol_func_name_test.name, '$mol_func_name_test');
|
|
1934
1934
|
},
|
|
1935
1935
|
});
|
|
1936
1936
|
})($ || ($ = {}));
|
|
1937
|
-
//mol/
|
|
1937
|
+
//mol/func/name/name.test.ts
|
|
1938
1938
|
;
|
|
1939
1939
|
"use strict";
|
|
1940
1940
|
var $;
|