MCPcopy
hub / github.com/vuejs/core / hasMultipleChildren

Function hasMultipleChildren

packages/compiler-dom/src/transforms/Transition.ts:59–70  ·  view source on GitHub ↗
(node: ComponentNode | IfBranchNode)

Source from the content-addressed store, hash-verified

57}
58
59function 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}

Callers 1

transformTransitionFunction · 0.85

Calls 3

isCommentOrWhitespaceFunction · 0.90
someMethod · 0.80
filterMethod · 0.65

Tested by

no test coverage detected