(node: ComponentNode | IfBranchNode)
| 57 | } |
| 58 | |
| 59 | function hasMultipleChildren(node: ComponentNode | IfBranchNode): boolean { |
| 60 | // filter out potential comment nodes (#1352) and whitespace (#4637) |
| 61 | const children = (node.children = node.children.filter( |
| 62 | c => !isCommentOrWhitespace(c), |
| 63 | )) |
| 64 | const child = children[0] |
| 65 | return ( |
| 66 | children.length !== 1 || |
| 67 | child.type === NodeTypes.FOR || |
| 68 | (child.type === NodeTypes.IF && child.branches.some(hasMultipleChildren)) |
| 69 | ) |
| 70 | } |
no test coverage detected