Skip to content

Commit 407c8be

Browse files
committed
Emits safe value for import.
1 parent 387da2f commit 407c8be

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/compiler/utilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ namespace ts {
240240
// Make an identifier from an external module name by extracting the string after the last "/" and replacing
241241
// all non-alphanumeric characters with underscores
242242
export function makeIdentifierFromModuleName(moduleName: string): string {
243-
return getBaseFileName(moduleName).replace(/\W/g, "_");
243+
return getBaseFileName(moduleName).replace(/^(\d)/, "_$1").replace(/\W/g, "_");
244244
}
245245

246246
export function isBlockOrCatchScoped(declaration: Declaration) {

0 commit comments

Comments
 (0)