Skip to content

Commit d71c793

Browse files
committed
Style
1 parent 7bcf0d6 commit d71c793

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/utils/hasContent.ts

+5-9
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,11 @@ function hasDirective(node: AST.VElement, name: string) {
1313
}
1414

1515
function hasChildWithDirective(node: AST.VElement, name: string): boolean {
16-
return node.children.some((child) => {
17-
if (child.type !== "VElement") return false;
18-
19-
if (hasDirective(child, name)) {
20-
return true;
21-
}
22-
23-
return hasChildWithDirective(child, name)
24-
});
16+
return node.children.some(
17+
(child) =>
18+
child.type === "VElement" &&
19+
(hasDirective(child, name) || hasChildWithDirective(child, name))
20+
);
2521
}
2622

2723
function hasChildImageWithAlt(node: AST.VElement): boolean {

0 commit comments

Comments
 (0)