mol_conform 0.0.1 → 0.0.2
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/README.md +3 -3
- package/node.test.js +21 -18
- package/node.test.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# $mol_conform
|
|
2
2
|
|
|
3
|
-
Conforms two data structures to one with reference uniqueness for different content.
|
|
4
|
-
This is same thing as React Reconciler but for any data.
|
|
3
|
+
Conforms two data structures to one with reference uniqueness for different content and reference identity for deep equal content.
|
|
4
|
+
This is same thing as React Reconciler but for any data.
|
|
5
5
|
|
|
6
6
|
## Usage example
|
|
7
7
|
|
|
@@ -37,5 +37,5 @@ Provides custom conforming function for class (not for subclasses).
|
|
|
37
37
|
## Supported by default types
|
|
38
38
|
|
|
39
39
|
- Primitives: `Undefined`, `Null`, `Boolean`, `Number`, `String`.
|
|
40
|
-
- POJO: `Object`, `Array`.
|
|
40
|
+
- POJO: `Object`, `Array`, `TypedArray`.
|
|
41
41
|
- Native value objects: `Date`, `RegExp`.
|
package/node.test.js
CHANGED
|
@@ -665,6 +665,21 @@ var $;
|
|
|
665
665
|
};
|
|
666
666
|
})($ || ($ = {}));
|
|
667
667
|
|
|
668
|
+
;
|
|
669
|
+
"use strict";
|
|
670
|
+
var $;
|
|
671
|
+
(function ($) {
|
|
672
|
+
function $mol_guid(length = 8, exists = () => false) {
|
|
673
|
+
for (;;) {
|
|
674
|
+
let id = Math.random().toString(36).substring(2, length + 2).toUpperCase();
|
|
675
|
+
if (exists(id))
|
|
676
|
+
continue;
|
|
677
|
+
return id;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
$.$mol_guid = $mol_guid;
|
|
681
|
+
})($ || ($ = {}));
|
|
682
|
+
|
|
668
683
|
;
|
|
669
684
|
"use strict";
|
|
670
685
|
var $;
|
|
@@ -683,6 +698,11 @@ var $;
|
|
|
683
698
|
var $;
|
|
684
699
|
(function ($) {
|
|
685
700
|
class $mol_wire_pub extends Object {
|
|
701
|
+
constructor(id = `$mol_wire_pub:${$mol_guid()}`) {
|
|
702
|
+
super();
|
|
703
|
+
this[Symbol.toStringTag] = id;
|
|
704
|
+
}
|
|
705
|
+
[Symbol.toStringTag];
|
|
686
706
|
data = [];
|
|
687
707
|
static get [Symbol.species]() {
|
|
688
708
|
return Array;
|
|
@@ -1174,7 +1194,6 @@ var $;
|
|
|
1174
1194
|
}
|
|
1175
1195
|
}
|
|
1176
1196
|
}
|
|
1177
|
-
[Symbol.toStringTag];
|
|
1178
1197
|
cache = undefined;
|
|
1179
1198
|
get args() {
|
|
1180
1199
|
return this.data.slice(0, this.pub_from);
|
|
@@ -1193,13 +1212,12 @@ var $;
|
|
|
1193
1212
|
return this.task.name + '()';
|
|
1194
1213
|
}
|
|
1195
1214
|
constructor(id, task, host, args) {
|
|
1196
|
-
super();
|
|
1215
|
+
super(id);
|
|
1197
1216
|
this.task = task;
|
|
1198
1217
|
this.host = host;
|
|
1199
1218
|
if (args)
|
|
1200
1219
|
this.data.push(...args);
|
|
1201
1220
|
this.pub_from = this.sub_from = args?.length ?? 0;
|
|
1202
|
-
this[Symbol.toStringTag] = id;
|
|
1203
1221
|
}
|
|
1204
1222
|
plan() {
|
|
1205
1223
|
$mol_wire_fiber.planning.add(this);
|
|
@@ -2509,21 +2527,6 @@ var $;
|
|
|
2509
2527
|
});
|
|
2510
2528
|
})($ || ($ = {}));
|
|
2511
2529
|
|
|
2512
|
-
;
|
|
2513
|
-
"use strict";
|
|
2514
|
-
var $;
|
|
2515
|
-
(function ($) {
|
|
2516
|
-
function $mol_guid(length = 8, exists = () => false) {
|
|
2517
|
-
for (;;) {
|
|
2518
|
-
let id = Math.random().toString(36).substring(2, length + 2).toUpperCase();
|
|
2519
|
-
if (exists(id))
|
|
2520
|
-
continue;
|
|
2521
|
-
return id;
|
|
2522
|
-
}
|
|
2523
|
-
}
|
|
2524
|
-
$.$mol_guid = $mol_guid;
|
|
2525
|
-
})($ || ($ = {}));
|
|
2526
|
-
|
|
2527
2530
|
;
|
|
2528
2531
|
"use strict";
|
|
2529
2532
|
var $;
|