mol_db 0.0.572 → 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/web.test.js CHANGED
@@ -172,9 +172,6 @@ var $;
172
172
  //mol/dom/render/children/children.ts
173
173
  ;
174
174
  "use strict";
175
- //mol/type/partial/deep/deep.ts
176
- ;
177
- "use strict";
178
175
  //mol/type/error/error.ts
179
176
  ;
180
177
  "use strict";
@@ -184,106 +181,13 @@ var $;
184
181
  //mol/type/assert/assert.test.ts
185
182
  ;
186
183
  "use strict";
187
- //mol/type/equals/equals.ts
188
- ;
189
- "use strict";
190
- //mol/type/equals/equals.test.ts
184
+ //mol/type/partial/deep/deep.ts
191
185
  ;
192
186
  "use strict";
193
187
  //mol/type/partial/deep/deep.test.ts
194
188
  ;
195
189
  "use strict";
196
190
  var $;
197
- (function ($) {
198
- $mol_test({
199
- 'Make empty div'() {
200
- $mol_assert_equal(($mol_jsx("div", null)).outerHTML, '<div></div>');
201
- },
202
- 'Define native field'() {
203
- const dom = $mol_jsx("input", { value: '123' });
204
- $mol_assert_equal(dom.outerHTML, '<input value="123">');
205
- $mol_assert_equal(dom.value, '123');
206
- },
207
- 'Define classes'() {
208
- const dom = $mol_jsx("div", { class: 'foo bar' });
209
- $mol_assert_equal(dom.outerHTML, '<div class="foo bar"></div>');
210
- },
211
- 'Define styles'() {
212
- const dom = $mol_jsx("div", { style: { color: 'red' } });
213
- $mol_assert_equal(dom.outerHTML, '<div style="color: red;"></div>');
214
- },
215
- 'Define dataset'() {
216
- const dom = $mol_jsx("div", { dataset: { foo: 'bar' } });
217
- $mol_assert_equal(dom.outerHTML, '<div data-foo="bar"></div>');
218
- },
219
- 'Define attributes'() {
220
- const dom = $mol_jsx("div", { lang: "ru", hidden: true });
221
- $mol_assert_equal(dom.outerHTML, '<div lang="ru" hidden=""></div>');
222
- },
223
- 'Define child nodes'() {
224
- const dom = $mol_jsx("div", null,
225
- "hello",
226
- $mol_jsx("strong", null, "world"),
227
- "!");
228
- $mol_assert_equal(dom.outerHTML, '<div>hello<strong>world</strong>!</div>');
229
- },
230
- 'Function as component'() {
231
- const Button = (props, target) => {
232
- return $mol_jsx("button", { title: props.hint }, target());
233
- };
234
- const dom = $mol_jsx(Button, { id: "foo", hint: "click me" }, () => 'hey!');
235
- $mol_assert_equal(dom.outerHTML, '<button id="foo" title="click me" class="Button">hey!</button>');
236
- },
237
- 'Nested guid generation'() {
238
- const Foo = () => {
239
- return $mol_jsx("div", null,
240
- $mol_jsx(Bar, { id: "bar" },
241
- $mol_jsx("img", { id: "icon" })));
242
- };
243
- const Bar = (props, icon) => {
244
- return $mol_jsx("span", null,
245
- icon,
246
- $mol_jsx("i", { id: "label" }));
247
- };
248
- const dom = $mol_jsx(Foo, { id: "foo" });
249
- $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>');
250
- },
251
- 'Fail on non unique ids'() {
252
- const App = () => {
253
- return $mol_jsx("div", null,
254
- $mol_jsx("span", { id: "bar" }),
255
- $mol_jsx("span", { id: "bar" }));
256
- };
257
- $mol_assert_fail(() => $mol_jsx(App, { id: "foo" }), 'JSX already has tag with id "foo/bar"');
258
- },
259
- 'Owner based guid generationn'() {
260
- const Foo = () => {
261
- return $mol_jsx("div", null,
262
- $mol_jsx(Bar, { id: "middle", icon: () => $mol_jsx("img", { id: "icon" }) }));
263
- };
264
- const Bar = (props) => {
265
- return $mol_jsx("span", null, props.icon());
266
- };
267
- const dom = $mol_jsx(Foo, { id: "app" });
268
- $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>');
269
- },
270
- 'Fail on same ids from different caller'() {
271
- const Foo = () => {
272
- return $mol_jsx("div", null,
273
- $mol_jsx("img", { id: "icon" }),
274
- $mol_jsx(Bar, { id: "bar", icon: () => $mol_jsx("img", { id: "icon" }) }));
275
- };
276
- const Bar = (props) => {
277
- return $mol_jsx("span", null, props.icon());
278
- };
279
- $mol_assert_fail(() => $mol_jsx(Foo, { id: "foo" }), 'JSX already has tag with id "foo/icon"');
280
- },
281
- });
282
- })($ || ($ = {}));
283
- //mol/jsx/jsx.test.tsx
284
- ;
285
- "use strict";
286
- var $;
287
191
  (function ($) {
288
192
  $.$mol_jsx_prefix = '';
289
193
  $.$mol_jsx_crumbs = '';
@@ -407,97 +311,91 @@ var $;
407
311
  var $;
408
312
  (function ($) {
409
313
  $mol_test({
410
- 'nulls & undefineds'() {
411
- $mol_assert_ok($mol_compare_deep(null, null));
412
- $mol_assert_ok($mol_compare_deep(undefined, undefined));
413
- $mol_assert_not($mol_compare_deep(undefined, null));
414
- $mol_assert_not($mol_compare_deep({}, null));
415
- },
416
- 'number'() {
417
- $mol_assert_ok($mol_compare_deep(1, 1));
418
- $mol_assert_ok($mol_compare_deep(Number.NaN, Number.NaN));
419
- $mol_assert_not($mol_compare_deep(1, 2));
420
- $mol_assert_ok($mol_compare_deep(Object(1), Object(1)));
421
- $mol_assert_not($mol_compare_deep(Object(1), Object(2)));
314
+ 'Make empty div'() {
315
+ $mol_assert_equal(($mol_jsx("div", null)).outerHTML, '<div></div>');
422
316
  },
423
- 'POJO'() {
424
- $mol_assert_ok($mol_compare_deep({}, {}));
425
- $mol_assert_not($mol_compare_deep({ a: 1 }, { b: 2 }));
426
- $mol_assert_not($mol_compare_deep({ a: 1 }, { a: 2 }));
427
- $mol_assert_not($mol_compare_deep({}, { a: undefined }));
428
- $mol_assert_ok($mol_compare_deep({ a: 1, b: 2 }, { b: 2, a: 1 }));
429
- $mol_assert_ok($mol_compare_deep({ a: { b: 1 } }, { a: { b: 1 } }));
317
+ 'Define native field'() {
318
+ const dom = $mol_jsx("input", { value: '123' });
319
+ $mol_assert_equal(dom.outerHTML, '<input value="123">');
320
+ $mol_assert_equal(dom.value, '123');
430
321
  },
431
- 'Array'() {
432
- $mol_assert_ok($mol_compare_deep([], []));
433
- $mol_assert_ok($mol_compare_deep([1, [2]], [1, [2]]));
434
- $mol_assert_not($mol_compare_deep([1, 2], [1, 3]));
435
- $mol_assert_not($mol_compare_deep([1, 2,], [1, 3, undefined]));
322
+ 'Define classes'() {
323
+ const dom = $mol_jsx("div", { class: 'foo bar' });
324
+ $mol_assert_equal(dom.outerHTML, '<div class="foo bar"></div>');
436
325
  },
437
- 'Non POJO are different'() {
438
- class Thing extends Object {
439
- }
440
- $mol_assert_not($mol_compare_deep(new Thing, new Thing));
441
- $mol_assert_not($mol_compare_deep(() => 1, () => 1));
442
- $mol_assert_not($mol_compare_deep(new RangeError('Test error'), new RangeError('Test error')));
326
+ 'Define styles'() {
327
+ const dom = $mol_jsx("div", { style: { color: 'red' } });
328
+ $mol_assert_equal(dom.outerHTML, '<div style="color: red;"></div>');
443
329
  },
444
- 'same POJOs with cyclic reference'() {
445
- const a = { foo: {} };
446
- a['self'] = a;
447
- const b = { foo: {} };
448
- b['self'] = b;
449
- $mol_assert_ok($mol_compare_deep(a, b));
330
+ 'Define dataset'() {
331
+ const dom = $mol_jsx("div", { dataset: { foo: 'bar' } });
332
+ $mol_assert_equal(dom.outerHTML, '<div data-foo="bar"></div>');
450
333
  },
451
- 'Date'() {
452
- $mol_assert_ok($mol_compare_deep(new Date(12345), new Date(12345)));
453
- $mol_assert_not($mol_compare_deep(new Date(12345), new Date(12346)));
334
+ 'Define attributes'() {
335
+ const dom = $mol_jsx("div", { lang: "ru", hidden: true });
336
+ $mol_assert_equal(dom.outerHTML, '<div lang="ru" hidden=""></div>');
454
337
  },
455
- 'RegExp'() {
456
- $mol_assert_ok($mol_compare_deep(/\x22/mig, /\x22/mig));
457
- $mol_assert_not($mol_compare_deep(/\x22/mig, /\x21/mig));
458
- $mol_assert_not($mol_compare_deep(/\x22/mig, /\x22/mg));
338
+ 'Define child nodes'() {
339
+ const dom = $mol_jsx("div", null,
340
+ "hello",
341
+ $mol_jsx("strong", null, "world"),
342
+ "!");
343
+ $mol_assert_equal(dom.outerHTML, '<div>hello<strong>world</strong>!</div>');
459
344
  },
460
- 'Error'() {
461
- $mol_assert_not($mol_compare_deep(new Error('xxx'), new Error('xxx')));
462
- const fail = (message) => new Error(message);
463
- $mol_assert_ok($mol_compare_deep(...['xxx', 'xxx'].map(msg => new Error(msg))));
464
- $mol_assert_not($mol_compare_deep(...['xxx', 'yyy'].map(msg => new Error(msg))));
345
+ 'Function as component'() {
346
+ const Button = (props, target) => {
347
+ return $mol_jsx("button", { title: props.hint }, target());
348
+ };
349
+ const dom = $mol_jsx(Button, { id: "foo", hint: "click me" }, () => 'hey!');
350
+ $mol_assert_equal(dom.outerHTML, '<button id="foo" title="click me" class="Button">hey!</button>');
465
351
  },
466
- 'Map'() {
467
- $mol_assert_ok($mol_compare_deep(new Map, new Map));
468
- $mol_assert_ok($mol_compare_deep(new Map([[1, [2]]]), new Map([[1, [2]]])));
469
- $mol_assert_ok($mol_compare_deep(new Map([[[1], 2]]), new Map([[[1], 2]])));
470
- $mol_assert_not($mol_compare_deep(new Map([[1, 2]]), new Map([[1, 3]])));
471
- $mol_assert_not($mol_compare_deep(new Map([[[1], 2]]), new Map([[[3], 2]])));
352
+ 'Nested guid generation'() {
353
+ const Foo = () => {
354
+ return $mol_jsx("div", null,
355
+ $mol_jsx(Bar, { id: "bar" },
356
+ $mol_jsx("img", { id: "icon" })));
357
+ };
358
+ const Bar = (props, icon) => {
359
+ return $mol_jsx("span", null,
360
+ icon,
361
+ $mol_jsx("i", { id: "label" }));
362
+ };
363
+ const dom = $mol_jsx(Foo, { id: "foo" });
364
+ $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>');
472
365
  },
473
- 'Set'() {
474
- $mol_assert_ok($mol_compare_deep(new Set, new Set));
475
- $mol_assert_ok($mol_compare_deep(new Set([1, [2]]), new Set([1, [2]])));
476
- $mol_assert_not($mol_compare_deep(new Set([1]), new Set([2])));
366
+ 'Fail on non unique ids'() {
367
+ const App = () => {
368
+ return $mol_jsx("div", null,
369
+ $mol_jsx("span", { id: "bar" }),
370
+ $mol_jsx("span", { id: "bar" }));
371
+ };
372
+ $mol_assert_fail(() => $mol_jsx(App, { id: "foo" }), 'JSX already has tag with id "foo/bar"');
477
373
  },
478
- 'Uint8Array'() {
479
- $mol_assert_ok($mol_compare_deep(new Uint8Array, new Uint8Array));
480
- $mol_assert_ok($mol_compare_deep(new Uint8Array([0]), new Uint8Array([0])));
481
- $mol_assert_not($mol_compare_deep(new Uint8Array([0]), new Uint8Array([1])));
374
+ 'Owner based guid generationn'() {
375
+ const Foo = () => {
376
+ return $mol_jsx("div", null,
377
+ $mol_jsx(Bar, { id: "middle", icon: () => $mol_jsx("img", { id: "icon" }) }));
378
+ };
379
+ const Bar = (props) => {
380
+ return $mol_jsx("span", null, props.icon());
381
+ };
382
+ const dom = $mol_jsx(Foo, { id: "app" });
383
+ $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>');
482
384
  },
483
- 'Custom comparator'() {
484
- class User {
485
- name;
486
- rand;
487
- constructor(name, rand = Math.random()) {
488
- this.name = name;
489
- this.rand = rand;
490
- }
491
- [Symbol.toPrimitive](mode) {
492
- return this.name;
493
- }
494
- }
495
- $mol_assert_ok($mol_compare_deep(new User('Jin'), new User('Jin')));
496
- $mol_assert_not($mol_compare_deep(new User('Jin'), new User('John')));
385
+ 'Fail on same ids from different caller'() {
386
+ const Foo = () => {
387
+ return $mol_jsx("div", null,
388
+ $mol_jsx("img", { id: "icon" }),
389
+ $mol_jsx(Bar, { id: "bar", icon: () => $mol_jsx("img", { id: "icon" }) }));
390
+ };
391
+ const Bar = (props) => {
392
+ return $mol_jsx("span", null, props.icon());
393
+ };
394
+ $mol_assert_fail(() => $mol_jsx(Foo, { id: "foo" }), 'JSX already has tag with id "foo/icon"');
497
395
  },
498
396
  });
499
397
  })($ || ($ = {}));
500
- //mol/compare/deep/deep.test.tsx
398
+ //mol/jsx/jsx.test.tsx
501
399
  ;
502
400
  "use strict";
503
401
  var $;
@@ -626,6 +524,102 @@ var $;
626
524
  ;
627
525
  "use strict";
628
526
  var $;
527
+ (function ($) {
528
+ $mol_test({
529
+ 'nulls & undefineds'() {
530
+ $mol_assert_ok($mol_compare_deep(null, null));
531
+ $mol_assert_ok($mol_compare_deep(undefined, undefined));
532
+ $mol_assert_not($mol_compare_deep(undefined, null));
533
+ $mol_assert_not($mol_compare_deep({}, null));
534
+ },
535
+ 'number'() {
536
+ $mol_assert_ok($mol_compare_deep(1, 1));
537
+ $mol_assert_ok($mol_compare_deep(Number.NaN, Number.NaN));
538
+ $mol_assert_not($mol_compare_deep(1, 2));
539
+ $mol_assert_ok($mol_compare_deep(Object(1), Object(1)));
540
+ $mol_assert_not($mol_compare_deep(Object(1), Object(2)));
541
+ },
542
+ 'POJO'() {
543
+ $mol_assert_ok($mol_compare_deep({}, {}));
544
+ $mol_assert_not($mol_compare_deep({ a: 1 }, { b: 2 }));
545
+ $mol_assert_not($mol_compare_deep({ a: 1 }, { a: 2 }));
546
+ $mol_assert_not($mol_compare_deep({}, { a: undefined }));
547
+ $mol_assert_ok($mol_compare_deep({ a: 1, b: 2 }, { b: 2, a: 1 }));
548
+ $mol_assert_ok($mol_compare_deep({ a: { b: 1 } }, { a: { b: 1 } }));
549
+ },
550
+ 'Array'() {
551
+ $mol_assert_ok($mol_compare_deep([], []));
552
+ $mol_assert_ok($mol_compare_deep([1, [2]], [1, [2]]));
553
+ $mol_assert_not($mol_compare_deep([1, 2], [1, 3]));
554
+ $mol_assert_not($mol_compare_deep([1, 2,], [1, 3, undefined]));
555
+ },
556
+ 'Non POJO are different'() {
557
+ class Thing extends Object {
558
+ }
559
+ $mol_assert_not($mol_compare_deep(new Thing, new Thing));
560
+ $mol_assert_not($mol_compare_deep(() => 1, () => 1));
561
+ $mol_assert_not($mol_compare_deep(new RangeError('Test error'), new RangeError('Test error')));
562
+ },
563
+ 'same POJOs with cyclic reference'() {
564
+ const a = { foo: {} };
565
+ a['self'] = a;
566
+ const b = { foo: {} };
567
+ b['self'] = b;
568
+ $mol_assert_ok($mol_compare_deep(a, b));
569
+ },
570
+ 'Date'() {
571
+ $mol_assert_ok($mol_compare_deep(new Date(12345), new Date(12345)));
572
+ $mol_assert_not($mol_compare_deep(new Date(12345), new Date(12346)));
573
+ },
574
+ 'RegExp'() {
575
+ $mol_assert_ok($mol_compare_deep(/\x22/mig, /\x22/mig));
576
+ $mol_assert_not($mol_compare_deep(/\x22/mig, /\x21/mig));
577
+ $mol_assert_not($mol_compare_deep(/\x22/mig, /\x22/mg));
578
+ },
579
+ 'Error'() {
580
+ $mol_assert_not($mol_compare_deep(new Error('xxx'), new Error('xxx')));
581
+ const fail = (message) => new Error(message);
582
+ $mol_assert_ok($mol_compare_deep(...['xxx', 'xxx'].map(msg => new Error(msg))));
583
+ $mol_assert_not($mol_compare_deep(...['xxx', 'yyy'].map(msg => new Error(msg))));
584
+ },
585
+ 'Map'() {
586
+ $mol_assert_ok($mol_compare_deep(new Map, new Map));
587
+ $mol_assert_ok($mol_compare_deep(new Map([[1, [2]]]), new Map([[1, [2]]])));
588
+ $mol_assert_ok($mol_compare_deep(new Map([[[1], 2]]), new Map([[[1], 2]])));
589
+ $mol_assert_not($mol_compare_deep(new Map([[1, 2]]), new Map([[1, 3]])));
590
+ $mol_assert_not($mol_compare_deep(new Map([[[1], 2]]), new Map([[[3], 2]])));
591
+ },
592
+ 'Set'() {
593
+ $mol_assert_ok($mol_compare_deep(new Set, new Set));
594
+ $mol_assert_ok($mol_compare_deep(new Set([1, [2]]), new Set([1, [2]])));
595
+ $mol_assert_not($mol_compare_deep(new Set([1]), new Set([2])));
596
+ },
597
+ 'Uint8Array'() {
598
+ $mol_assert_ok($mol_compare_deep(new Uint8Array, new Uint8Array));
599
+ $mol_assert_ok($mol_compare_deep(new Uint8Array([0]), new Uint8Array([0])));
600
+ $mol_assert_not($mol_compare_deep(new Uint8Array([0]), new Uint8Array([1])));
601
+ },
602
+ 'Custom comparator'() {
603
+ class User {
604
+ name;
605
+ rand;
606
+ constructor(name, rand = Math.random()) {
607
+ this.name = name;
608
+ this.rand = rand;
609
+ }
610
+ [Symbol.toPrimitive](mode) {
611
+ return this.name;
612
+ }
613
+ }
614
+ $mol_assert_ok($mol_compare_deep(new User('Jin'), new User('Jin')));
615
+ $mol_assert_not($mol_compare_deep(new User('Jin'), new User('John')));
616
+ },
617
+ });
618
+ })($ || ($ = {}));
619
+ //mol/compare/deep/deep.test.tsx
620
+ ;
621
+ "use strict";
622
+ var $;
629
623
  (function ($) {
630
624
  function $mol_dom_serialize(node) {
631
625
  const serializer = new $mol_dom_context.XMLSerializer;
@@ -837,24 +831,16 @@ var $;
837
831
  //mol/log3/log3.ts
838
832
  ;
839
833
  "use strict";
840
- //mol/type/keys/extract/extract.ts
834
+ //mol/type/equals/equals.ts
841
835
  ;
842
836
  "use strict";
843
- //mol/type/keys/extract/extract.test.ts
837
+ //mol/type/equals/equals.test.ts
844
838
  ;
845
839
  "use strict";
846
- var $;
847
- (function ($_1) {
848
- $mol_test_mocks.push($ => {
849
- $.$mol_log3_come = () => { };
850
- $.$mol_log3_done = () => { };
851
- $.$mol_log3_fail = () => { };
852
- $.$mol_log3_warn = () => { };
853
- $.$mol_log3_rise = () => { };
854
- $.$mol_log3_area = () => () => { };
855
- });
856
- })($ || ($ = {}));
857
- //mol/log3/log3.test.ts
840
+ //mol/type/keys/extract/extract.ts
841
+ ;
842
+ "use strict";
843
+ //mol/type/keys/extract/extract.test.ts
858
844
  ;
859
845
  "use strict";
860
846
  var $;
@@ -887,6 +873,20 @@ var $;
887
873
  ;
888
874
  "use strict";
889
875
  var $;
876
+ (function ($_1) {
877
+ $mol_test_mocks.push($ => {
878
+ $.$mol_log3_come = () => { };
879
+ $.$mol_log3_done = () => { };
880
+ $.$mol_log3_fail = () => { };
881
+ $.$mol_log3_warn = () => { };
882
+ $.$mol_log3_rise = () => { };
883
+ $.$mol_log3_area = () => () => { };
884
+ });
885
+ })($ || ($ = {}));
886
+ //mol/log3/log3.test.ts
887
+ ;
888
+ "use strict";
889
+ var $;
890
890
  (function ($) {
891
891
  const named = new WeakSet();
892
892
  function $mol_func_name(func) {