refactor(compiler-vapor): simplify ast check

This commit is contained in:
三咲智子 Kevin Deng 2024-05-12 17:58:11 +08:00
parent 0c33ace61c
commit 76595deefb
No known key found for this signature in database
1 changed files with 2 additions and 5 deletions

View File

@ -112,9 +112,6 @@ function createSlotBlock(
}
function isNonWhitespaceContent(node: TemplateChildNode): boolean {
if (node.type !== NodeTypes.TEXT && node.type !== NodeTypes.TEXT_CALL)
return true
return node.type === NodeTypes.TEXT
? !!node.content.trim()
: isNonWhitespaceContent(node.content)
if (node.type !== NodeTypes.TEXT) return true
return !!node.content.trim()
}