fix(60505): Convert to namespace import refactoring should drop file extensions on namespace name (#60510)

This commit is contained in:
Oleksandr T.
2024-11-20 05:42:16 +02:00
committed by GitHub
parent b3c67d3202
commit d6b7c41fbc
2 changed files with 19 additions and 1 deletions

View File

@@ -4061,7 +4061,7 @@ export function moduleSymbolToValidIdentifier(moduleSymbol: Symbol, target: Scri
/** @internal */
export function moduleSpecifierToValidIdentifier(moduleSpecifier: string, target: ScriptTarget | undefined, forceCapitalize?: boolean): string {
const baseName = getBaseFileName(removeSuffix(moduleSpecifier, "/index"));
const baseName = getBaseFileName(removeSuffix(removeFileExtension(moduleSpecifier), "/index"));
let res = "";
let lastCharWasValid = true;
const firstCharCode = baseName.charCodeAt(0);