mol_plot_all 1.2.129 → 1.2.133
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.d.ts +1 -10
- package/node.deps.json +1 -1
- package/node.esm.js +111 -78
- package/node.esm.js.map +1 -1
- package/node.js +111 -78
- package/node.js.map +1 -1
- package/node.test.js +138 -442
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.d.ts +1 -10
- package/web.deps.json +1 -1
- package/web.esm.js +111 -78
- package/web.esm.js.map +1 -1
- package/web.js +111 -78
- package/web.js.map +1 -1
- package/web.test.js +24 -361
- package/web.test.js.map +1 -1
package/web.js
CHANGED
|
@@ -549,91 +549,125 @@ var $;
|
|
|
549
549
|
"use strict";
|
|
550
550
|
var $;
|
|
551
551
|
(function ($) {
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
552
|
+
let cache = new WeakMap();
|
|
553
|
+
function $mol_compare_deep(left, right) {
|
|
554
|
+
if (Object.is(left, right))
|
|
555
|
+
return true;
|
|
556
|
+
if (left === null)
|
|
557
|
+
return false;
|
|
558
|
+
if (right === null)
|
|
559
|
+
return false;
|
|
560
|
+
if (typeof left !== 'object')
|
|
561
|
+
return false;
|
|
562
|
+
if (typeof right !== 'object')
|
|
563
|
+
return false;
|
|
564
|
+
const left_proto = Reflect.getPrototypeOf(left);
|
|
565
|
+
const right_proto = Reflect.getPrototypeOf(right);
|
|
566
|
+
if (left_proto !== right_proto)
|
|
567
|
+
return false;
|
|
568
|
+
if (left instanceof Boolean)
|
|
569
|
+
return Object.is(left.valueOf(), right['valueOf']());
|
|
570
|
+
if (left instanceof Number)
|
|
571
|
+
return Object.is(left.valueOf(), right['valueOf']());
|
|
572
|
+
if (left instanceof String)
|
|
573
|
+
return Object.is(left.valueOf(), right['valueOf']());
|
|
574
|
+
if (left instanceof Date)
|
|
575
|
+
return Object.is(left.valueOf(), right['valueOf']());
|
|
576
|
+
if (left instanceof RegExp)
|
|
577
|
+
return left.source === right['source'] && left.flags === right['flags'];
|
|
578
|
+
let left_cache = cache.get(left);
|
|
579
|
+
if (left_cache) {
|
|
580
|
+
const right_cache = left_cache.get(right);
|
|
581
|
+
if (typeof right_cache === 'boolean')
|
|
582
|
+
return right_cache;
|
|
583
|
+
}
|
|
584
|
+
else {
|
|
585
|
+
left_cache = new WeakMap([[right, true]]);
|
|
586
|
+
cache.set(left, left_cache);
|
|
587
|
+
}
|
|
588
|
+
let result;
|
|
576
589
|
try {
|
|
577
|
-
|
|
590
|
+
if (left_proto && !Reflect.getPrototypeOf(left_proto))
|
|
591
|
+
result = compare_pojo(left, right);
|
|
592
|
+
else if (Array.isArray(left))
|
|
593
|
+
result = compare_array(left, right);
|
|
594
|
+
else if (left instanceof Set)
|
|
595
|
+
result = compare_set(left, right);
|
|
596
|
+
else if (left instanceof Map)
|
|
597
|
+
result = compare_map(left, right);
|
|
598
|
+
else if (ArrayBuffer.isView(left))
|
|
599
|
+
result = compare_buffer(left, right);
|
|
600
|
+
else if (Symbol.toPrimitive in left)
|
|
601
|
+
result = compare_primitive(left, right);
|
|
602
|
+
else
|
|
603
|
+
result = false;
|
|
578
604
|
}
|
|
579
605
|
finally {
|
|
580
|
-
|
|
606
|
+
left_cache.set(right, result);
|
|
581
607
|
}
|
|
608
|
+
return result;
|
|
582
609
|
}
|
|
583
|
-
$.$
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
if (!Object.is(source[i], target[i]))
|
|
594
|
-
return target;
|
|
595
|
-
}
|
|
596
|
-
return source;
|
|
610
|
+
$.$mol_compare_deep = $mol_compare_deep;
|
|
611
|
+
function compare_array(left, right) {
|
|
612
|
+
const len = left.length;
|
|
613
|
+
if (len !== right.length)
|
|
614
|
+
return false;
|
|
615
|
+
for (let i = 0; i < len; ++i) {
|
|
616
|
+
if (!$mol_compare_deep(left[i], right[i]))
|
|
617
|
+
return false;
|
|
618
|
+
}
|
|
619
|
+
return true;
|
|
597
620
|
}
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
let equal = true;
|
|
606
|
-
for (let key in target) {
|
|
607
|
-
const conformed = $mol_conform(target[key], source[key]);
|
|
608
|
-
if (conformed !== target[key]) {
|
|
609
|
-
try {
|
|
610
|
-
target[key] = conformed;
|
|
611
|
-
}
|
|
612
|
-
catch (error) { }
|
|
613
|
-
if (!Object.is(conformed, target[key]))
|
|
614
|
-
equal = false;
|
|
615
|
-
}
|
|
616
|
-
if (!Object.is(conformed, source[key]))
|
|
617
|
-
equal = false;
|
|
618
|
-
++count;
|
|
621
|
+
function compare_buffer(left, right) {
|
|
622
|
+
const len = left.byteLength;
|
|
623
|
+
if (len !== right.byteLength)
|
|
624
|
+
return false;
|
|
625
|
+
for (let i = 0; i < len; ++i) {
|
|
626
|
+
if (left[i] !== right[i])
|
|
627
|
+
return false;
|
|
619
628
|
}
|
|
620
|
-
|
|
621
|
-
|
|
629
|
+
return true;
|
|
630
|
+
}
|
|
631
|
+
function compare_iterator(left, right, compare) {
|
|
632
|
+
while (true) {
|
|
633
|
+
const left_next = left.next();
|
|
634
|
+
const right_next = right.next();
|
|
635
|
+
if (left_next.done !== right_next.done)
|
|
636
|
+
return false;
|
|
637
|
+
if (left_next.done)
|
|
622
638
|
break;
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
639
|
+
if (!compare(left_next.value, right_next.value))
|
|
640
|
+
return false;
|
|
641
|
+
}
|
|
642
|
+
return true;
|
|
643
|
+
}
|
|
644
|
+
function compare_set(left, right) {
|
|
645
|
+
if (left.size !== right.size)
|
|
646
|
+
return false;
|
|
647
|
+
return compare_iterator(left.values(), right.values(), $mol_compare_deep);
|
|
648
|
+
}
|
|
649
|
+
function compare_map(left, right) {
|
|
650
|
+
if (left.size !== right.size)
|
|
651
|
+
return false;
|
|
652
|
+
return compare_iterator(left.keys(), right.keys(), Object.is)
|
|
653
|
+
&& compare_iterator(left.values(), right.values(), $mol_compare_deep);
|
|
654
|
+
}
|
|
655
|
+
function compare_pojo(left, right) {
|
|
656
|
+
const left_keys = Object.getOwnPropertyNames(left);
|
|
657
|
+
const right_keys = Object.getOwnPropertyNames(right);
|
|
658
|
+
if (left_keys.length !== right_keys.length)
|
|
659
|
+
return false;
|
|
660
|
+
for (let key of left_keys) {
|
|
661
|
+
if (!$mol_compare_deep(left[key], Reflect.get(right, key)))
|
|
662
|
+
return false;
|
|
663
|
+
}
|
|
664
|
+
return true;
|
|
665
|
+
}
|
|
666
|
+
function compare_primitive(left, right) {
|
|
667
|
+
return Object.is(left[Symbol.toPrimitive]('default'), right[Symbol.toPrimitive]('default'));
|
|
668
|
+
}
|
|
635
669
|
})($ || ($ = {}));
|
|
636
|
-
//
|
|
670
|
+
//deep.js.map
|
|
637
671
|
;
|
|
638
672
|
"use strict";
|
|
639
673
|
var $;
|
|
@@ -960,8 +994,7 @@ var $;
|
|
|
960
994
|
}
|
|
961
995
|
}
|
|
962
996
|
push(value) {
|
|
963
|
-
|
|
964
|
-
if (this.error !== null || !Object.is(this.value, value)) {
|
|
997
|
+
if (this.error !== null || !$.$mol_compare_deep(this.value, value)) {
|
|
965
998
|
if ($mol_fiber.logs)
|
|
966
999
|
this.$.$mol_log3_done({
|
|
967
1000
|
place: this,
|