File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import {
26
26
removeFileExtension ,
27
27
removeMinAndVersionNumbers ,
28
28
some ,
29
+ toFileNameLowerCase ,
29
30
TypeAcquisition ,
30
31
Version ,
31
32
versionMajorMinor ,
@@ -313,8 +314,8 @@ export function discoverTypings(
313
314
// packages. So that needs this dance here.
314
315
const pathComponents = getPathComponents ( normalizePath ( manifestPath ) ) ;
315
316
const isScoped = pathComponents [ pathComponents . length - 3 ] [ 0 ] === "@" ;
316
- return isScoped && pathComponents [ pathComponents . length - 4 ] . toLowerCase ( ) === modulesDirName || // `node_modules/@foo/bar`
317
- ! isScoped && pathComponents [ pathComponents . length - 3 ] . toLowerCase ( ) === modulesDirName ; // `node_modules/foo`
317
+ return isScoped && toFileNameLowerCase ( pathComponents [ pathComponents . length - 4 ] ) === modulesDirName || // `node_modules/@foo/bar`
318
+ ! isScoped && toFileNameLowerCase ( pathComponents [ pathComponents . length - 3 ] ) === modulesDirName ; // `node_modules/foo`
318
319
} ) ;
319
320
320
321
if ( log ) log ( `Searching for typing names in ${ packagesFolderPath } ; all files: ${ JSON . stringify ( dependencyManifestNames ) } ` ) ;
@@ -361,7 +362,7 @@ export function discoverTypings(
361
362
const fromFileNames = mapDefined ( fileNames , j => {
362
363
if ( ! hasJSFileExtension ( j ) ) return undefined ;
363
364
364
- const inferredTypingName = removeFileExtension ( getBaseFileName ( j . toLowerCase ( ) ) ) ;
365
+ const inferredTypingName = removeFileExtension ( toFileNameLowerCase ( getBaseFileName ( j ) ) ) ;
365
366
const cleanedTypingName = removeMinAndVersionNumbers ( inferredTypingName ) ;
366
367
return safeList . get ( cleanedTypingName ) ;
367
368
} ) ;
Original file line number Diff line number Diff line change @@ -459,7 +459,7 @@ export class LanguageServiceShimHostAdapter implements LanguageServiceHost {
459
459
if ( "getTypeReferenceDirectiveResolutionsForFile" in this . shimHost ) {
460
460
this . resolveTypeReferenceDirectives = ( typeDirectiveNames , containingFile ) => {
461
461
const typeDirectivesForFile = JSON . parse ( this . shimHost . getTypeReferenceDirectiveResolutionsForFile ! ( containingFile ) ) as MapLike < ResolvedTypeReferenceDirective > ; // TODO: GH#18217
462
- return map ( typeDirectiveNames as ( string | FileReference ) [ ] , name => getProperty ( typeDirectivesForFile , isString ( name ) ? name : name . fileName . toLowerCase ( ) ) ) ;
462
+ return map ( typeDirectiveNames as ( string | FileReference ) [ ] , name => getProperty ( typeDirectivesForFile , isString ( name ) ? name : toFileNameLowerCase ( name . fileName ) ) ) ;
463
463
} ;
464
464
}
465
465
}
You can’t perform that action at this time.
0 commit comments