@@ -11,6 +11,7 @@ namespace ts {
11
11
directoryExists ?( path : string ) : boolean ;
12
12
getDirectories ?( path : string ) : string [ ] ;
13
13
readDirectory ?( path : string , extensions ?: ReadonlyArray < string > , exclude ?: ReadonlyArray < string > , include ?: ReadonlyArray < string > , depth ?: number ) : string [ ] ;
14
+ realpath ?( path : string ) : string ;
14
15
15
16
createDirectory ?( path : string ) : void ;
16
17
writeFile ?( path : string , data : string , writeByteOrderMark ?: boolean ) : void ;
@@ -56,7 +57,8 @@ namespace ts {
56
57
writeFile : host . writeFile && writeFile ,
57
58
addOrDeleteFileOrDirectory,
58
59
addOrDeleteFile,
59
- clearCache
60
+ clearCache,
61
+ realpath : host . realpath && realpath
60
62
} ;
61
63
62
64
function toPath ( fileName : string ) {
@@ -170,7 +172,7 @@ namespace ts {
170
172
const rootDirPath = toPath ( rootDir ) ;
171
173
const result = tryReadDirectory ( rootDir , rootDirPath ) ;
172
174
if ( result ) {
173
- return matchFiles ( rootDir , extensions , excludes , includes , useCaseSensitiveFileNames , currentDirectory , depth , getFileSystemEntries ) ;
175
+ return matchFiles ( rootDir , extensions , excludes , includes , useCaseSensitiveFileNames , currentDirectory , depth , getFileSystemEntries , realpath ) ;
174
176
}
175
177
return host . readDirectory ! ( rootDir , extensions , excludes , includes , depth ) ;
176
178
@@ -183,6 +185,10 @@ namespace ts {
183
185
}
184
186
}
185
187
188
+ function realpath ( s : string ) {
189
+ return host . realpath ? host . realpath ( s ) : s ;
190
+ }
191
+
186
192
function addOrDeleteFileOrDirectory ( fileOrDirectory : string , fileOrDirectoryPath : Path ) {
187
193
const existingResult = getCachedFileSystemEntries ( fileOrDirectoryPath ) ;
188
194
if ( existingResult ) {
0 commit comments