@@ -6091,9 +6091,9 @@ namespace ts {
6091
6091
}
6092
6092
6093
6093
export interface SymlinkCache {
6094
- /** Gets a map from symlink to realpath */
6094
+ /** Gets a map from symlink to realpath. Keys have trailing directory separators. */
6095
6095
getSymlinkedDirectories ( ) : ReadonlyESMap < Path , SymlinkedDirectory | false > | undefined ;
6096
- /** Gets a map from realpath to symlinks */
6096
+ /** Gets a map from realpath to symlinks. Keys have trailing directory separators. */
6097
6097
getSymlinkedDirectoriesByRealpath ( ) : MultiMap < Path , Path > | undefined ;
6098
6098
/** Gets a map from symlink to realpath */
6099
6099
getSymlinkedFiles ( ) : ReadonlyESMap < Path , string > | undefined ;
@@ -6115,8 +6115,9 @@ namespace ts {
6115
6115
// where both the realpath and the symlink path are inside node_modules/.pnpm. Since
6116
6116
// this path is never a candidate for a module specifier, we can ignore it entirely.
6117
6117
if ( ! pathContainsPnpmDirectory ( symlinkPath ) ) {
6118
+ symlinkPath = ensureTrailingDirectorySeparator ( symlinkPath ) ;
6118
6119
if ( directory !== false && ! symlinkedDirectories ?. has ( symlinkPath ) ) {
6119
- ( symlinkedDirectoriesByRealpath ||= createMultiMap ( ) ) . add ( directory . realPath , symlinkPath )
6120
+ ( symlinkedDirectoriesByRealpath ||= createMultiMap ( ) ) . add ( ensureTrailingDirectorySeparator ( directory . realPath ) , symlinkPath ) ;
6120
6121
}
6121
6122
( symlinkedDirectories || ( symlinkedDirectories = new Map ( ) ) ) . set ( symlinkPath , directory ) ;
6122
6123
}
@@ -6133,7 +6134,7 @@ namespace ts {
6133
6134
const [ commonResolved , commonOriginal ] = guessDirectorySymlink ( resolvedPath , originalPath , cwd , getCanonicalFileName ) || emptyArray ;
6134
6135
if ( commonResolved && commonOriginal ) {
6135
6136
cache . setSymlinkedDirectory (
6136
- toPath ( commonOriginal , cwd , getCanonicalFileName ) ,
6137
+ ensureTrailingDirectorySeparator ( toPath ( commonOriginal , cwd , getCanonicalFileName ) ) ,
6137
6138
{ real : commonResolved , realPath : toPath ( commonResolved , cwd , getCanonicalFileName ) } ) ;
6138
6139
}
6139
6140
}
0 commit comments