mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 20:32:10 +00:00
refactor(ast) improve ExportDefaultDeclarationKind's is_typescript_syntax() method (#2561)
This commit is contained in:
parent
18cff6aab8
commit
3d354d44a3
1 changed files with 3 additions and 11 deletions
|
|
@ -2407,19 +2407,11 @@ impl<'a> ExportDefaultDeclarationKind<'a> {
|
|||
#[inline]
|
||||
pub fn is_typescript_syntax(&self) -> bool {
|
||||
match self {
|
||||
ExportDefaultDeclarationKind::FunctionDeclaration(func)
|
||||
if func.is_typescript_syntax() =>
|
||||
{
|
||||
true
|
||||
}
|
||||
ExportDefaultDeclarationKind::ClassDeclaration(class)
|
||||
if class.is_typescript_syntax() =>
|
||||
{
|
||||
true
|
||||
}
|
||||
ExportDefaultDeclarationKind::FunctionDeclaration(func) => func.is_typescript_syntax(),
|
||||
ExportDefaultDeclarationKind::ClassDeclaration(class) => class.is_typescript_syntax(),
|
||||
ExportDefaultDeclarationKind::TSInterfaceDeclaration(_)
|
||||
| ExportDefaultDeclarationKind::TSEnumDeclaration(_) => true,
|
||||
_ => false,
|
||||
ExportDefaultDeclarationKind::Expression(_) => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue