Skip to content

Commit

Permalink
fix: ployfill for missing function in tsc
Browse files Browse the repository at this point in the history
  • Loading branch information
KazariEX committed Aug 10, 2024
1 parent b1b5f2d commit 0f65e06
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/language-core/lib/codegen/template/element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ function* generateReferencesForScopedCssClasses(
ts.forEachChild(ast, node => {
if (
!ts.isExpressionStatement(node) ||
!ts.isTemplateExpression(node.expression)
!isTemplateExpression(node.expression)
) return;

const expression = node.expression.templateSpans[0].expression;
Expand Down Expand Up @@ -694,4 +694,9 @@ function collectClasses(content: string, startOffset = 0) {
}
}
return classes;
}

// isTemplateExpression is missing in tsc
function isTemplateExpression(node: ts.Node): node is ts.TemplateExpression {
return node.kind === 228 satisfies ts.SyntaxKind.TemplateExpression;
}

0 comments on commit 0f65e06

Please sign in to comment.