( root: RootNode, )
| 49 | } |
| 50 | |
| 51 | export function getSingleElementRoot( |
| 52 | root: RootNode, |
| 53 | ): PlainElementNode | ComponentNode | TemplateNode | null { |
| 54 | const children = root.children.filter(x => x.type !== NodeTypes.COMMENT) |
| 55 | return children.length === 1 && |
| 56 | children[0].type === NodeTypes.ELEMENT && |
| 57 | !isSlotOutlet(children[0]) |
| 58 | ? children[0] |
| 59 | : null |
| 60 | } |
| 61 | |
| 62 | function walk( |
| 63 | node: ParentNode, |
no test coverage detected