@@ -382,7 +382,7 @@ namespace ts {
382382 }
383383
384384 interface DiagnosticCache {
385- perFile ?: FileMap < Diagnostic [ ] > ;
385+ perFile ?: Map < Diagnostic [ ] > ;
386386 allDiagnostics ?: Diagnostic [ ] ;
387387 }
388388
@@ -472,7 +472,7 @@ namespace ts {
472472 resolveTypeReferenceDirectiveNamesWorker = ( typeReferenceDirectiveNames , containingFile ) => loadWithLocalCache ( typeReferenceDirectiveNames , containingFile , loader ) ;
473473 }
474474
475- const filesByName = createFileMap < SourceFile > ( ) ;
475+ const filesByName = createMap < SourceFile > ( ) ;
476476 // stores 'filename -> file association' ignoring case
477477 // used to track cases when two file names differ only in casing
478478 const filesByNameIgnoreCase = host . useCaseSensitiveFileNames ( ) ? createFileMap < SourceFile > ( fileName => fileName . toLowerCase ( ) ) : undefined ;
@@ -1314,7 +1314,7 @@ namespace ts {
13141314 const result = getDiagnostics ( sourceFile , cancellationToken ) || emptyArray ;
13151315 if ( sourceFile ) {
13161316 if ( ! cache . perFile ) {
1317- cache . perFile = createFileMap < Diagnostic [ ] > ( ) ;
1317+ cache . perFile = createMap < Diagnostic [ ] > ( ) ;
13181318 }
13191319 cache . perFile . set ( sourceFile . path , result ) ;
13201320 }
@@ -1531,7 +1531,7 @@ namespace ts {
15311531
15321532 // Get source file from normalized fileName
15331533 function findSourceFile ( fileName : string , path : Path , isDefaultLib : boolean , refFile ?: SourceFile , refPos ?: number , refEnd ?: number ) : SourceFile {
1534- if ( filesByName . contains ( path ) ) {
1534+ if ( filesByName . has ( path ) ) {
15351535 const file = filesByName . get ( path ) ;
15361536 // try to check if we've already seen this file but with a different casing in path
15371537 // NOTE: this only makes sense for case-insensitive file systems
@@ -1951,7 +1951,7 @@ namespace ts {
19511951 // If the emit is enabled make sure that every output file is unique and not overwriting any of the input files
19521952 if ( ! options . noEmit && ! options . suppressOutputPathCheck ) {
19531953 const emitHost = getEmitHost ( ) ;
1954- const emitFilesSeen = createFileMap < boolean > ( ! host . useCaseSensitiveFileNames ( ) ? key => key . toLocaleLowerCase ( ) : undefined ) ;
1954+ const emitFilesSeen = createFileMap < boolean > ( ! host . useCaseSensitiveFileNames ( ) ? key => key . toLocaleLowerCase ( ) : key => key ) ;
19551955 forEachEmittedFile ( emitHost , ( emitFileNames ) => {
19561956 verifyEmitFilePath ( emitFileNames . jsFilePath , emitFilesSeen ) ;
19571957 verifyEmitFilePath ( emitFileNames . declarationFilePath , emitFilesSeen ) ;
@@ -1963,7 +1963,7 @@ namespace ts {
19631963 if ( emitFileName ) {
19641964 const emitFilePath = toPath ( emitFileName , currentDirectory , getCanonicalFileName ) ;
19651965 // Report error if the output overwrites input file
1966- if ( filesByName . contains ( emitFilePath ) ) {
1966+ if ( filesByName . has ( emitFilePath ) ) {
19671967 let chain : DiagnosticMessageChain ;
19681968 if ( ! options . configFilePath ) {
19691969 // The program is from either an inferred project or an external project
0 commit comments