File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
src/typescript/worker/lib Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ export function createWatchSolutionBuilderHost<TProgram extends ts.BuilderProgra
45
45
writeFile ( path : string , data : string ) : void {
46
46
system . writeFile ( path , data ) ;
47
47
} ,
48
- getModifiedTime ( fileName : string ) : Date | undefined {
48
+ getModifiedTime ( fileName : string | undefined ) : Date | undefined {
49
49
return system . getModifiedTime ( fileName ) ;
50
50
} ,
51
51
setModifiedTime ( fileName : string , date : Date ) : void {
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export interface ControlledTypeScriptSystem extends ts.System {
32
32
recursive ?: boolean ,
33
33
options ?: ts . WatchOptions
34
34
) : ts . FileWatcher ;
35
- getModifiedTime ( path : string ) : Date | undefined ;
35
+ getModifiedTime ( path : string | undefined ) : Date | undefined ;
36
36
setModifiedTime ( path : string , time : Date ) : void ;
37
37
deleteFile ( path : string ) : void ;
38
38
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -113,9 +113,12 @@ export const system: ControlledTypeScriptSystem = {
113
113
)
114
114
. map ( ( dirent ) => dirent . name ) ;
115
115
} ,
116
- getModifiedTime ( path : string ) : Date | undefined {
117
- const stats = getReadFileSystem ( path ) . readStats ( path ) ;
116
+ getModifiedTime ( path : string | undefined ) : Date | undefined {
117
+ if ( path === undefined ) {
118
+ return undefined ;
119
+ }
118
120
121
+ const stats = getReadFileSystem ( path ) . readStats ( path ) ;
119
122
if ( stats ) {
120
123
return stats . mtime ;
121
124
}
You can’t perform that action at this time.
0 commit comments