j-templates 7.0.103 → 7.0.105
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/vNode.js +10 -20
- package/_not_used/array.js +2 -1
- package/package.json +1 -1
package/Node/vNode.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.vNode = void 0;
|
|
4
|
+
const array_1 = require("../_not_used/array");
|
|
4
5
|
const Store_1 = require("../Store");
|
|
5
6
|
const observableScope_1 = require("../Store/Tree/observableScope");
|
|
6
7
|
const emitter_1 = require("../Utils/emitter");
|
|
@@ -204,29 +205,18 @@ function ToArray(result) {
|
|
|
204
205
|
return result;
|
|
205
206
|
return [result];
|
|
206
207
|
}
|
|
207
|
-
function
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
switch (vnode.type) {
|
|
214
|
-
case vNode_types_1.FRAGMENT_NODE:
|
|
215
|
-
FlattenFragmentsRecursive(vnode.children, 0, result);
|
|
216
|
-
default:
|
|
217
|
-
if (vnode.node !== null)
|
|
218
|
-
result.push(vnode.node);
|
|
219
|
-
}
|
|
208
|
+
function MapNode(vnode) {
|
|
209
|
+
switch (vnode.type) {
|
|
210
|
+
case vNode_types_1.FRAGMENT_NODE:
|
|
211
|
+
return vnode.children.flatMap(MapNode);
|
|
212
|
+
default:
|
|
213
|
+
return vnode.node;
|
|
220
214
|
}
|
|
221
|
-
return result;
|
|
222
215
|
}
|
|
223
216
|
function CleanupChildrenArray(children) {
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
const result = [];
|
|
228
|
-
FlattenFragmentsRecursive(children, index, result);
|
|
229
|
-
return result;
|
|
217
|
+
const nodes = children.flatMap(MapNode);
|
|
218
|
+
(0, array_1.RemoveNulls)(nodes);
|
|
219
|
+
return nodes;
|
|
230
220
|
}
|
|
231
221
|
function UpdateChildren(vnode, init = false, skipInit = false) {
|
|
232
222
|
if (!vnode.children)
|
package/_not_used/array.js
CHANGED
|
@@ -33,7 +33,8 @@ function RemoveNulls(array, startIndex = 0) {
|
|
|
33
33
|
notNullIndex++;
|
|
34
34
|
for (; notNullIndex < array.length && array[notNullIndex] === null; notNullIndex++) { }
|
|
35
35
|
}
|
|
36
|
-
array.
|
|
36
|
+
if (nullIndex < array.length)
|
|
37
|
+
array.splice(nullIndex);
|
|
37
38
|
}
|
|
38
39
|
function ArrayDiff(source, target) {
|
|
39
40
|
if (source === target)
|