@@ -6079,9 +6079,9 @@ namespace ts {
6079
6079
}
6080
6080
6081
6081
export interface SymlinkCache {
6082
- /** Gets a map from symlink to realpath */
6082
+ /** Gets a map from symlink to realpath. Keys have trailing directory separators. */
6083
6083
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. */
6085
6085
getSymlinkedDirectoriesByRealpath ( ) : MultiMap < Path , Path > | undefined ;
6086
6086
/** Gets a map from symlink to realpath */
6087
6087
getSymlinkedFiles ( ) : ReadonlyESMap < Path , string > | undefined ;
@@ -6103,8 +6103,9 @@ namespace ts {
6103
6103
// where both the realpath and the symlink path are inside node_modules/.pnpm. Since
6104
6104
// this path is never a candidate for a module specifier, we can ignore it entirely.
6105
6105
if ( ! containsIgnoredPath ( symlinkPath ) ) {
6106
+ symlinkPath = ensureTrailingDirectorySeparator ( symlinkPath ) ;
6106
6107
if ( directory !== false && ! symlinkedDirectories ?. has ( symlinkPath ) ) {
6107
- ( symlinkedDirectoriesByRealpath ||= createMultiMap ( ) ) . add ( directory . realPath , symlinkPath )
6108
+ ( symlinkedDirectoriesByRealpath ||= createMultiMap ( ) ) . add ( ensureTrailingDirectorySeparator ( directory . realPath ) , symlinkPath ) ;
6108
6109
}
6109
6110
( symlinkedDirectories || ( symlinkedDirectories = new Map ( ) ) ) . set ( symlinkPath , directory ) ;
6110
6111
}
@@ -6121,7 +6122,7 @@ namespace ts {
6121
6122
const [ commonResolved , commonOriginal ] = guessDirectorySymlink ( resolvedPath , originalPath , cwd , getCanonicalFileName ) || emptyArray ;
6122
6123
if ( commonResolved && commonOriginal ) {
6123
6124
cache . setSymlinkedDirectory (
6124
- toPath ( commonOriginal , cwd , getCanonicalFileName ) ,
6125
+ ensureTrailingDirectorySeparator ( toPath ( commonOriginal , cwd , getCanonicalFileName ) ) ,
6125
6126
{ real : commonResolved , realPath : toPath ( commonResolved , cwd , getCanonicalFileName ) } ) ;
6126
6127
}
6127
6128
}
0 commit comments