From f0c3751be1a692e8c64d1dbe05cf2e23b6ee1875 Mon Sep 17 00:00:00 2001 From: "Alexis H. Munsayac" Date: Tue, 30 Jan 2024 19:58:40 +0800 Subject: [PATCH] Update register-import-specifiers.ts --- src/babel/core/register-import-specifiers.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/babel/core/register-import-specifiers.ts b/src/babel/core/register-import-specifiers.ts index 59287e1..297b68d 100644 --- a/src/babel/core/register-import-specifiers.ts +++ b/src/babel/core/register-import-specifiers.ts @@ -18,14 +18,13 @@ function registerImportSpecifier( return; } if (t.isImportSpecifier(specifier)) { + if (specifier.importKind === 'type' || specifier.importKind === 'typeof') { + return; + } + const name = getImportSpecifierName(specifier); if ( - (!( - specifier.importKind === 'type' || specifier.importKind === 'typeof' - ) && - id.definition.kind === 'named' && - getImportSpecifierName(specifier) === id.definition.name) || - (id.definition.kind === 'default' && - getImportSpecifierName(specifier) === 'default') + (id.definition.kind === 'named' && name === id.definition.name) || + (id.definition.kind === 'default' && name === 'default') ) { state.registrations.identifiers.set(specifier.local, id); }