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

Function isEmpty

packages/compiler-sfc/src/parse.ts:420–428  ·  view source on GitHub ↗

* Returns true if the node has no children * once the empty text nodes (trimmed content) have been filtered out.

(node: ElementNode)

Source from the content-addressed store, hash-verified

418 * once the empty text nodes (trimmed content) have been filtered out.
419 */
420function isEmpty(node: ElementNode) {
421 for (let i = 0; i < node.children.length; i++) {
422 const child = node.children[i]
423 if (child.type !== NodeTypes.TEXT || child.content.trim() !== '') {
424 return false
425 }
426 }
427 return true
428}
429
430/**
431 * Note: this comparison assumes the prev/next script are already identical,

Callers 1

parseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected