mol_time_all 1.1.499 → 1.1.501

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