j-templates 7.0.103 → 7.0.104
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 +4 -1
- package/package.json +1 -1
package/Node/vNode.js
CHANGED
|
@@ -207,6 +207,9 @@ function ToArray(result) {
|
|
|
207
207
|
function IsFragmentOrNull(vnode) {
|
|
208
208
|
return vnode === null || vnode.type === vNode_types_1.FRAGMENT_NODE;
|
|
209
209
|
}
|
|
210
|
+
function GetNode(vnode) {
|
|
211
|
+
return vnode.node;
|
|
212
|
+
}
|
|
210
213
|
function FlattenFragmentsRecursive(children, startIndex, result) {
|
|
211
214
|
for (let x = startIndex; x < children.length; x++) {
|
|
212
215
|
const vnode = children[x];
|
|
@@ -224,7 +227,7 @@ function CleanupChildrenArray(children) {
|
|
|
224
227
|
const index = children.findIndex(IsFragmentOrNull);
|
|
225
228
|
if (index < 0)
|
|
226
229
|
return children;
|
|
227
|
-
const result =
|
|
230
|
+
const result = children.slice(0, index).map(GetNode);
|
|
228
231
|
FlattenFragmentsRecursive(children, index, result);
|
|
229
232
|
return result;
|
|
230
233
|
}
|