From 84feceb118d59cb62d52da1a462c12e62d8b6c56 Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Fri, 31 May 2024 05:52:14 +0000 Subject: [PATCH] refactor(transformer): explicit skip TS statements in TS namespace transform (#3479) No substantive change. This should just be slightly more efficient as we've already handled most of the other variants earlier in the match. --- crates/oxc_transformer/src/typescript/namespace.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/crates/oxc_transformer/src/typescript/namespace.rs b/crates/oxc_transformer/src/typescript/namespace.rs index 50ddcdb59..71198b1b2 100644 --- a/crates/oxc_transformer/src/typescript/namespace.rs +++ b/crates/oxc_transformer/src/typescript/namespace.rs @@ -253,12 +253,10 @@ impl<'a> TypeScript<'a> { } } } - stmt => { - if let Some(decl) = stmt.as_declaration() { - if decl.is_typescript_syntax() { - continue; - } - } + Statement::TSTypeAliasDeclaration(_) + | Statement::TSInterfaceDeclaration(_) + | Statement::TSImportEqualsDeclaration(_) => {} + _ => { new_stmts.push(stmt); } }