@@ -6079,9 +6079,9 @@ namespace ts {
60796079 }
60806080
60816081 export interface SymlinkCache {
6082- /** Gets a map from symlink to realpath */
6082+ /** Gets a map from symlink to realpath. Keys have trailing directory separators. */
60836083 getSymlinkedDirectories ( ) : ReadonlyESMap < Path , SymlinkedDirectory | false > | undefined ;
6084- /** Gets a map from realpath to symlinks */
6084+ /** Gets a map from realpath to symlinks. Keys have trailing directory separators. */
60856085 getSymlinkedDirectoriesByRealpath ( ) : MultiMap < Path , Path > | undefined ;
60866086 /** Gets a map from symlink to realpath */
60876087 getSymlinkedFiles ( ) : ReadonlyESMap < Path , string > | undefined ;
@@ -6103,8 +6103,9 @@ namespace ts {
61036103 // where both the realpath and the symlink path are inside node_modules/.pnpm. Since
61046104 // this path is never a candidate for a module specifier, we can ignore it entirely.
61056105 if ( ! containsIgnoredPath ( symlinkPath ) ) {
6106+ symlinkPath = ensureTrailingDirectorySeparator ( symlinkPath ) ;
61066107 if ( directory !== false && ! symlinkedDirectories ?. has ( symlinkPath ) ) {
6107- ( symlinkedDirectoriesByRealpath ||= createMultiMap ( ) ) . add ( directory . realPath , symlinkPath )
6108+ ( symlinkedDirectoriesByRealpath ||= createMultiMap ( ) ) . add ( ensureTrailingDirectorySeparator ( directory . realPath ) , symlinkPath ) ;
61086109 }
61096110 ( symlinkedDirectories || ( symlinkedDirectories = new Map ( ) ) ) . set ( symlinkPath , directory ) ;
61106111 }
@@ -6121,7 +6122,7 @@ namespace ts {
61216122 const [ commonResolved , commonOriginal ] = guessDirectorySymlink ( resolvedPath , originalPath , cwd , getCanonicalFileName ) || emptyArray ;
61226123 if ( commonResolved && commonOriginal ) {
61236124 cache . setSymlinkedDirectory (
6124- toPath ( commonOriginal , cwd , getCanonicalFileName ) ,
6125+ ensureTrailingDirectorySeparator ( toPath ( commonOriginal , cwd , getCanonicalFileName ) ) ,
61256126 { real : commonResolved , realPath : toPath ( commonResolved , cwd , getCanonicalFileName ) } ) ;
61266127 }
61276128 }
0 commit comments