@@ -127,10 +127,6 @@ function resolveBaseExport(importedName: string): string | undefined {
127127 if ( importedName === 'UI5WCSlotsNode' ) {
128128 return `${ basePackageName } /types` ;
129129 }
130- //todo: why is this required?
131- // if (importedName === 'default' || importedName === 'index') {
132- // return basePackageName;
133- // }
134130 return undefined ;
135131}
136132
@@ -150,9 +146,6 @@ function resolveChartsExport(importedName: string): string | undefined {
150146 if ( directMap [ importedName ] ) {
151147 return directMap [ importedName ] ;
152148 }
153- if ( importedName === 'default' || importedName === 'index' ) {
154- return chartsPackageName ;
155- }
156149 return undefined ;
157150}
158151
@@ -169,7 +162,7 @@ export default function transform(file: FileInfo, api: API): string | undefined
169162 packageNames . forEach ( ( pkg ) => {
170163 root . find ( j . ImportDeclaration , { source : { value : pkg } } ) . forEach ( ( importPath ) => {
171164 const specifiers = importPath . node . specifiers || [ ] ;
172- specifiers . forEach ( ( spec : any ) => {
165+ specifiers . forEach ( ( spec ) => {
173166 if ( spec . type !== 'ImportSpecifier' ) return ;
174167 const importedName = spec . imported . name as string ;
175168 let componentName = importedName ;
@@ -210,7 +203,7 @@ export default function transform(file: FileInfo, api: API): string | undefined
210203 // Namespace import deltas
211204 if ( pkg === basePackageName && [ 'Device' , 'hooks' ] . includes ( importedName ) ) {
212205 const newImport = j . importDeclaration (
213- [ j . importNamespaceSpecifier ( j . identifier ( spec . local ?. name || importedName ) ) ] ,
206+ [ j . importNamespaceSpecifier ( j . identifier ( ( spec . local ?. name as string ) || importedName ) ) ] ,
214207 j . literal ( `${ basePackageName } /${ importedName } ` ) ,
215208 ) ;
216209 j ( importPath ) . insertBefore ( newImport ) ;
0 commit comments