mol_wire_lib 1.0.501 → 1.0.503

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 $;
@@ -2242,16 +2242,6 @@ var $;
2242
2242
  ;
2243
2243
  "use strict";
2244
2244
  var $;
2245
- (function ($) {
2246
- function $mol_test_complete() {
2247
- process.exit(0);
2248
- }
2249
- $.$mol_test_complete = $mol_test_complete;
2250
- })($ || ($ = {}));
2251
- //mol/test/test.node.test.ts
2252
- ;
2253
- "use strict";
2254
- var $;
2255
2245
  (function ($_1) {
2256
2246
  function $mol_test(set) {
2257
2247
  for (let name in set) {
@@ -2339,6 +2329,16 @@ var $;
2339
2329
  ;
2340
2330
  "use strict";
2341
2331
  var $;
2332
+ (function ($) {
2333
+ function $mol_test_complete() {
2334
+ process.exit(0);
2335
+ }
2336
+ $.$mol_test_complete = $mol_test_complete;
2337
+ })($ || ($ = {}));
2338
+ //mol/test/test.node.test.ts
2339
+ ;
2340
+ "use strict";
2341
+ var $;
2342
2342
  (function ($) {
2343
2343
  })($ || ($ = {}));
2344
2344
  //mol/dom/context/context.ts
@@ -2513,112 +2513,16 @@ var $;
2513
2513
  //mol/type/error/error.ts
2514
2514
  ;
2515
2515
  "use strict";
2516
- //mol/type/assert/assert.test.ts
2517
- ;
2518
- "use strict";
2519
2516
  //mol/type/assert/assert.ts
2520
2517
  ;
2521
2518
  "use strict";
2522
- //mol/type/equals/equals.test.ts
2523
- ;
2524
- "use strict";
2525
- //mol/type/equals/equals.ts
2526
- ;
2527
- "use strict";
2528
- //mol/type/partial/deep/deep.test.ts
2519
+ //mol/type/assert/assert.test.ts
2529
2520
  ;
2530
2521
  "use strict";
2531
2522
  //mol/type/partial/deep/deep.ts
2532
2523
  ;
2533
2524
  "use strict";
2534
- var $;
2535
- (function ($) {
2536
- $mol_test({
2537
- 'Make empty div'() {
2538
- $mol_assert_equal(($mol_jsx("div", null)).outerHTML, '<div></div>');
2539
- },
2540
- 'Define native field'() {
2541
- const dom = $mol_jsx("input", { value: '123' });
2542
- $mol_assert_equal(dom.outerHTML, '<input value="123">');
2543
- $mol_assert_equal(dom.value, '123');
2544
- },
2545
- 'Define classes'() {
2546
- const dom = $mol_jsx("div", { class: 'foo bar' });
2547
- $mol_assert_equal(dom.outerHTML, '<div class="foo bar"></div>');
2548
- },
2549
- 'Define styles'() {
2550
- const dom = $mol_jsx("div", { style: { color: 'red' } });
2551
- $mol_assert_equal(dom.outerHTML, '<div style="color: red;"></div>');
2552
- },
2553
- 'Define dataset'() {
2554
- const dom = $mol_jsx("div", { dataset: { foo: 'bar' } });
2555
- $mol_assert_equal(dom.outerHTML, '<div data-foo="bar"></div>');
2556
- },
2557
- 'Define attributes'() {
2558
- const dom = $mol_jsx("div", { lang: "ru", hidden: true });
2559
- $mol_assert_equal(dom.outerHTML, '<div lang="ru" hidden=""></div>');
2560
- },
2561
- 'Define child nodes'() {
2562
- const dom = $mol_jsx("div", null,
2563
- "hello",
2564
- $mol_jsx("strong", null, "world"),
2565
- "!");
2566
- $mol_assert_equal(dom.outerHTML, '<div>hello<strong>world</strong>!</div>');
2567
- },
2568
- 'Function as component'() {
2569
- const Button = (props, target) => {
2570
- return $mol_jsx("button", { title: props.hint }, target());
2571
- };
2572
- const dom = $mol_jsx(Button, { id: "foo", hint: "click me" }, () => 'hey!');
2573
- $mol_assert_equal(dom.outerHTML, '<button id="foo" title="click me" class="Button">hey!</button>');
2574
- },
2575
- 'Nested guid generation'() {
2576
- const Foo = () => {
2577
- return $mol_jsx("div", null,
2578
- $mol_jsx(Bar, { id: "bar" },
2579
- $mol_jsx("img", { id: "icon" })));
2580
- };
2581
- const Bar = (props, icon) => {
2582
- return $mol_jsx("span", null,
2583
- icon,
2584
- $mol_jsx("i", { id: "label" }));
2585
- };
2586
- const dom = $mol_jsx(Foo, { id: "foo" });
2587
- $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>');
2588
- },
2589
- 'Fail on non unique ids'() {
2590
- const App = () => {
2591
- return $mol_jsx("div", null,
2592
- $mol_jsx("span", { id: "bar" }),
2593
- $mol_jsx("span", { id: "bar" }));
2594
- };
2595
- $mol_assert_fail(() => $mol_jsx(App, { id: "foo" }), 'JSX already has tag with id "foo/bar"');
2596
- },
2597
- 'Owner based guid generationn'() {
2598
- const Foo = () => {
2599
- return $mol_jsx("div", null,
2600
- $mol_jsx(Bar, { id: "middle", icon: () => $mol_jsx("img", { id: "icon" }) }));
2601
- };
2602
- const Bar = (props) => {
2603
- return $mol_jsx("span", null, props.icon());
2604
- };
2605
- const dom = $mol_jsx(Foo, { id: "app" });
2606
- $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>');
2607
- },
2608
- 'Fail on same ids from different caller'() {
2609
- const Foo = () => {
2610
- return $mol_jsx("div", null,
2611
- $mol_jsx("img", { id: "icon" }),
2612
- $mol_jsx(Bar, { id: "bar", icon: () => $mol_jsx("img", { id: "icon" }) }));
2613
- };
2614
- const Bar = (props) => {
2615
- return $mol_jsx("span", null, props.icon());
2616
- };
2617
- $mol_assert_fail(() => $mol_jsx(Foo, { id: "foo" }), 'JSX already has tag with id "foo/icon"');
2618
- },
2619
- });
2620
- })($ || ($ = {}));
2621
- //mol/jsx/jsx.test.tsx
2525
+ //mol/type/partial/deep/deep.test.ts
2622
2526
  ;
2623
2527
  "use strict";
2624
2528
  var $;
@@ -2743,6 +2647,96 @@ var $;
2743
2647
  ;
2744
2648
  "use strict";
2745
2649
  var $;
2650
+ (function ($) {
2651
+ $mol_test({
2652
+ 'Make empty div'() {
2653
+ $mol_assert_equal(($mol_jsx("div", null)).outerHTML, '<div></div>');
2654
+ },
2655
+ 'Define native field'() {
2656
+ const dom = $mol_jsx("input", { value: '123' });
2657
+ $mol_assert_equal(dom.outerHTML, '<input value="123">');
2658
+ $mol_assert_equal(dom.value, '123');
2659
+ },
2660
+ 'Define classes'() {
2661
+ const dom = $mol_jsx("div", { class: 'foo bar' });
2662
+ $mol_assert_equal(dom.outerHTML, '<div class="foo bar"></div>');
2663
+ },
2664
+ 'Define styles'() {
2665
+ const dom = $mol_jsx("div", { style: { color: 'red' } });
2666
+ $mol_assert_equal(dom.outerHTML, '<div style="color: red;"></div>');
2667
+ },
2668
+ 'Define dataset'() {
2669
+ const dom = $mol_jsx("div", { dataset: { foo: 'bar' } });
2670
+ $mol_assert_equal(dom.outerHTML, '<div data-foo="bar"></div>');
2671
+ },
2672
+ 'Define attributes'() {
2673
+ const dom = $mol_jsx("div", { lang: "ru", hidden: true });
2674
+ $mol_assert_equal(dom.outerHTML, '<div lang="ru" hidden=""></div>');
2675
+ },
2676
+ 'Define child nodes'() {
2677
+ const dom = $mol_jsx("div", null,
2678
+ "hello",
2679
+ $mol_jsx("strong", null, "world"),
2680
+ "!");
2681
+ $mol_assert_equal(dom.outerHTML, '<div>hello<strong>world</strong>!</div>');
2682
+ },
2683
+ 'Function as component'() {
2684
+ const Button = (props, target) => {
2685
+ return $mol_jsx("button", { title: props.hint }, target());
2686
+ };
2687
+ const dom = $mol_jsx(Button, { id: "foo", hint: "click me" }, () => 'hey!');
2688
+ $mol_assert_equal(dom.outerHTML, '<button id="foo" title="click me" class="Button">hey!</button>');
2689
+ },
2690
+ 'Nested guid generation'() {
2691
+ const Foo = () => {
2692
+ return $mol_jsx("div", null,
2693
+ $mol_jsx(Bar, { id: "bar" },
2694
+ $mol_jsx("img", { id: "icon" })));
2695
+ };
2696
+ const Bar = (props, icon) => {
2697
+ return $mol_jsx("span", null,
2698
+ icon,
2699
+ $mol_jsx("i", { id: "label" }));
2700
+ };
2701
+ const dom = $mol_jsx(Foo, { id: "foo" });
2702
+ $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>');
2703
+ },
2704
+ 'Fail on non unique ids'() {
2705
+ const App = () => {
2706
+ return $mol_jsx("div", null,
2707
+ $mol_jsx("span", { id: "bar" }),
2708
+ $mol_jsx("span", { id: "bar" }));
2709
+ };
2710
+ $mol_assert_fail(() => $mol_jsx(App, { id: "foo" }), 'JSX already has tag with id "foo/bar"');
2711
+ },
2712
+ 'Owner based guid generationn'() {
2713
+ const Foo = () => {
2714
+ return $mol_jsx("div", null,
2715
+ $mol_jsx(Bar, { id: "middle", icon: () => $mol_jsx("img", { id: "icon" }) }));
2716
+ };
2717
+ const Bar = (props) => {
2718
+ return $mol_jsx("span", null, props.icon());
2719
+ };
2720
+ const dom = $mol_jsx(Foo, { id: "app" });
2721
+ $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>');
2722
+ },
2723
+ 'Fail on same ids from different caller'() {
2724
+ const Foo = () => {
2725
+ return $mol_jsx("div", null,
2726
+ $mol_jsx("img", { id: "icon" }),
2727
+ $mol_jsx(Bar, { id: "bar", icon: () => $mol_jsx("img", { id: "icon" }) }));
2728
+ };
2729
+ const Bar = (props) => {
2730
+ return $mol_jsx("span", null, props.icon());
2731
+ };
2732
+ $mol_assert_fail(() => $mol_jsx(Foo, { id: "foo" }), 'JSX already has tag with id "foo/icon"');
2733
+ },
2734
+ });
2735
+ })($ || ($ = {}));
2736
+ //mol/jsx/jsx.test.tsx
2737
+ ;
2738
+ "use strict";
2739
+ var $;
2746
2740
  (function ($) {
2747
2741
  $mol_test({
2748
2742
  'nulls & undefineds'() {
@@ -2850,38 +2844,6 @@ var $;
2850
2844
  ;
2851
2845
  "use strict";
2852
2846
  var $;
2853
- (function ($) {
2854
- $mol_test({
2855
- 'must be false'() {
2856
- $mol_assert_not(0);
2857
- },
2858
- 'must be true'() {
2859
- $mol_assert_ok(1);
2860
- },
2861
- 'two must be equal'() {
2862
- $mol_assert_equal(2, 2);
2863
- },
2864
- 'three must be equal'() {
2865
- $mol_assert_equal(2, 2, 2);
2866
- },
2867
- 'two must be unique'() {
2868
- $mol_assert_unique([3], [3]);
2869
- },
2870
- 'three must be unique'() {
2871
- $mol_assert_unique([3], [3], [3]);
2872
- },
2873
- 'two must be alike'() {
2874
- $mol_assert_like([3], [3]);
2875
- },
2876
- 'three must be alike'() {
2877
- $mol_assert_like([3], [3], [3]);
2878
- },
2879
- });
2880
- })($ || ($ = {}));
2881
- //mol/assert/assert.test.ts
2882
- ;
2883
- "use strict";
2884
- var $;
2885
2847
  (function ($) {
2886
2848
  function $mol_assert_ok(value) {
2887
2849
  if (value)
@@ -2976,6 +2938,47 @@ var $;
2976
2938
  ;
2977
2939
  "use strict";
2978
2940
  var $;
2941
+ (function ($) {
2942
+ $mol_test({
2943
+ 'must be false'() {
2944
+ $mol_assert_not(0);
2945
+ },
2946
+ 'must be true'() {
2947
+ $mol_assert_ok(1);
2948
+ },
2949
+ 'two must be equal'() {
2950
+ $mol_assert_equal(2, 2);
2951
+ },
2952
+ 'three must be equal'() {
2953
+ $mol_assert_equal(2, 2, 2);
2954
+ },
2955
+ 'two must be unique'() {
2956
+ $mol_assert_unique([3], [3]);
2957
+ },
2958
+ 'three must be unique'() {
2959
+ $mol_assert_unique([3], [3], [3]);
2960
+ },
2961
+ 'two must be alike'() {
2962
+ $mol_assert_like([3], [3]);
2963
+ },
2964
+ 'three must be alike'() {
2965
+ $mol_assert_like([3], [3], [3]);
2966
+ },
2967
+ });
2968
+ })($ || ($ = {}));
2969
+ //mol/assert/assert.test.ts
2970
+ ;
2971
+ "use strict";
2972
+ //mol/type/equals/equals.ts
2973
+ ;
2974
+ "use strict";
2975
+ //mol/type/equals/equals.test.ts
2976
+ ;
2977
+ "use strict";
2978
+ //mol/type/writable/writable.test.ts
2979
+ ;
2980
+ "use strict";
2981
+ var $;
2979
2982
  (function ($) {
2980
2983
  $mol_test({
2981
2984
  'get'() {
@@ -3038,9 +3041,6 @@ var $;
3038
3041
  //mol/delegate/delegate.test.ts
3039
3042
  ;
3040
3043
  "use strict";
3041
- //mol/type/writable/writable.test.ts
3042
- ;
3043
- "use strict";
3044
3044
  var $;
3045
3045
  (function ($_1) {
3046
3046
  $mol_test({
@@ -3312,6 +3312,67 @@ var $;
3312
3312
  ;
3313
3313
  "use strict";
3314
3314
  var $;
3315
+ (function ($) {
3316
+ $mol_test({
3317
+ 'Primitives'() {
3318
+ $mol_assert_equal($mol_key(null), 'null');
3319
+ $mol_assert_equal($mol_key(false), 'false');
3320
+ $mol_assert_equal($mol_key(true), 'true');
3321
+ $mol_assert_equal($mol_key(0), '0');
3322
+ $mol_assert_equal($mol_key(''), '""');
3323
+ },
3324
+ 'Array & POJO'() {
3325
+ $mol_assert_equal($mol_key([null]), '[null]');
3326
+ $mol_assert_equal($mol_key({ foo: 0 }), '{"foo":0}');
3327
+ $mol_assert_equal($mol_key({ foo: [false] }), '{"foo":[false]}');
3328
+ },
3329
+ 'Function'() {
3330
+ const func = () => { };
3331
+ $mol_assert_equal($mol_key(func), $mol_key(func));
3332
+ $mol_assert_unique($mol_key(func), $mol_key(() => { }));
3333
+ },
3334
+ 'Objects'() {
3335
+ class User {
3336
+ }
3337
+ const jin = new User();
3338
+ $mol_assert_equal($mol_key(jin), $mol_key(jin));
3339
+ $mol_assert_unique($mol_key(jin), $mol_key(new User()));
3340
+ },
3341
+ 'Elements'() {
3342
+ const foo = $mol_jsx("div", null, "bar");
3343
+ $mol_assert_equal($mol_key(foo), $mol_key(foo));
3344
+ $mol_assert_unique($mol_key(foo), $mol_key($mol_jsx("div", null, "bar")));
3345
+ },
3346
+ 'Custom JSON representation'() {
3347
+ class User {
3348
+ name;
3349
+ age;
3350
+ constructor(name, age) {
3351
+ this.name = name;
3352
+ this.age = age;
3353
+ }
3354
+ toJSON() { return { name: this.name }; }
3355
+ }
3356
+ $mol_assert_equal($mol_key(new User('jin', 18)), '{"name":"jin"}');
3357
+ },
3358
+ 'Special native classes'() {
3359
+ $mol_assert_equal($mol_key(new Date('xyz')), 'null');
3360
+ $mol_assert_equal($mol_key(new Date('2001-01-02T03:04:05.678Z')), '"2001-01-02T03:04:05.678Z"');
3361
+ $mol_assert_equal($mol_key(/./), '"/./"');
3362
+ $mol_assert_equal($mol_key(/\./gimsu), '"/\\\\./gimsu"');
3363
+ },
3364
+ });
3365
+ })($ || ($ = {}));
3366
+ //mol/key/key.test.tsx
3367
+ ;
3368
+ "use strict";
3369
+ //mol/type/tail/tail.test.ts
3370
+ ;
3371
+ "use strict";
3372
+ //mol/type/foot/foot.test.ts
3373
+ ;
3374
+ "use strict";
3375
+ var $;
3315
3376
  (function ($_1) {
3316
3377
  $mol_test({
3317
3378
  async 'Latest method calls wins'($) {
@@ -3354,9 +3415,6 @@ var $;
3354
3415
  //mol/wire/async/async.test.ts
3355
3416
  ;
3356
3417
  "use strict";
3357
- //mol/type/tail/tail.test.ts
3358
- ;
3359
- "use strict";
3360
3418
  var $;
3361
3419
  (function ($_1) {
3362
3420
  $mol_test({
@@ -3947,64 +4005,6 @@ var $;
3947
4005
  ;
3948
4006
  "use strict";
3949
4007
  var $;
3950
- (function ($) {
3951
- $mol_test({
3952
- 'Primitives'() {
3953
- $mol_assert_equal($mol_key(null), 'null');
3954
- $mol_assert_equal($mol_key(false), 'false');
3955
- $mol_assert_equal($mol_key(true), 'true');
3956
- $mol_assert_equal($mol_key(0), '0');
3957
- $mol_assert_equal($mol_key(''), '""');
3958
- },
3959
- 'Array & POJO'() {
3960
- $mol_assert_equal($mol_key([null]), '[null]');
3961
- $mol_assert_equal($mol_key({ foo: 0 }), '{"foo":0}');
3962
- $mol_assert_equal($mol_key({ foo: [false] }), '{"foo":[false]}');
3963
- },
3964
- 'Function'() {
3965
- const func = () => { };
3966
- $mol_assert_equal($mol_key(func), $mol_key(func));
3967
- $mol_assert_unique($mol_key(func), $mol_key(() => { }));
3968
- },
3969
- 'Objects'() {
3970
- class User {
3971
- }
3972
- const jin = new User();
3973
- $mol_assert_equal($mol_key(jin), $mol_key(jin));
3974
- $mol_assert_unique($mol_key(jin), $mol_key(new User()));
3975
- },
3976
- 'Elements'() {
3977
- const foo = $mol_jsx("div", null, "bar");
3978
- $mol_assert_equal($mol_key(foo), $mol_key(foo));
3979
- $mol_assert_unique($mol_key(foo), $mol_key($mol_jsx("div", null, "bar")));
3980
- },
3981
- 'Custom JSON representation'() {
3982
- class User {
3983
- name;
3984
- age;
3985
- constructor(name, age) {
3986
- this.name = name;
3987
- this.age = age;
3988
- }
3989
- toJSON() { return { name: this.name }; }
3990
- }
3991
- $mol_assert_equal($mol_key(new User('jin', 18)), '{"name":"jin"}');
3992
- },
3993
- 'Special native classes'() {
3994
- $mol_assert_equal($mol_key(new Date('xyz')), 'null');
3995
- $mol_assert_equal($mol_key(new Date('2001-01-02T03:04:05.678Z')), '"2001-01-02T03:04:05.678Z"');
3996
- $mol_assert_equal($mol_key(/./), '"/./"');
3997
- $mol_assert_equal($mol_key(/\./gimsu), '"/\\\\./gimsu"');
3998
- },
3999
- });
4000
- })($ || ($ = {}));
4001
- //mol/key/key.test.tsx
4002
- ;
4003
- "use strict";
4004
- //mol/type/foot/foot.test.ts
4005
- ;
4006
- "use strict";
4007
- var $;
4008
4008
  (function ($) {
4009
4009
  $mol_wire_log.active();
4010
4010
  })($ || ($ = {}));