Skip to content

Commit

Permalink
Update register-import-specifiers.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
lxsmnsyc committed Jan 30, 2024
1 parent bda1ad8 commit f0c3751
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/babel/core/register-import-specifiers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit f0c3751

Please sign in to comment.