|
1 | 1 | import { VNode, Point, RelativePosition } from '../../core/src/VNodes/VNode'; |
2 | | -import { nodeName, nodeLength, FlattenUnion } from '../../utils/src/utils'; |
| 2 | +import { nodeName, nodeLength, FlattenUnion, flat } from '../../utils/src/utils'; |
3 | 3 | import { styleToObject } from '../../utils/src/Dom'; |
4 | 4 | import { AbstractNode } from '../../core/src/VNodes/AbstractNode'; |
5 | 5 | import { ContainerNode } from '../../core/src/VNodes/ContainerNode'; |
@@ -1218,16 +1218,18 @@ export class DomReconciliationEngine { |
1218 | 1218 | // Insert children in the dom which locate with the placeholder. |
1219 | 1219 | for (const [ref, position, childIds] of object.domNodesChildren) { |
1220 | 1220 | if (position === RelativePosition.INSIDE) { |
1221 | | - const childDomNodes = childIds |
1222 | | - .map(childId => this._getDomChild(childId, ref as Element | ShadowRoot)) |
1223 | | - .flat(); |
| 1221 | + const childDomNodes = flat( |
| 1222 | + childIds.map(childId => |
| 1223 | + this._getDomChild(childId, ref as Element | ShadowRoot), |
| 1224 | + ), |
| 1225 | + ); |
1224 | 1226 | for (const domNode of childDomNodes) { |
1225 | 1227 | ref.appendChild(domNode); |
1226 | 1228 | } |
1227 | 1229 | } else { |
1228 | | - const childDomNodes = childIds |
1229 | | - .map(childId => this._getDomChild(childId, ref.parentElement)) |
1230 | | - .flat(); |
| 1230 | + const childDomNodes = flat( |
| 1231 | + childIds.map(childId => this._getDomChild(childId, ref.parentElement)), |
| 1232 | + ); |
1231 | 1233 | if (position === RelativePosition.BEFORE) { |
1232 | 1234 | for (const domNode of childDomNodes) { |
1233 | 1235 | ref.parentElement.insertBefore(domNode, ref); |
|
0 commit comments