@@ -33,7 +33,7 @@ namespace ts {
3333 export interface FileWatcher {
3434 close ( ) : void ;
3535 }
36-
36+
3737 export interface DirWatcher extends FileWatcher {
3838 referenceCount : number ;
3939 }
@@ -320,36 +320,38 @@ namespace ts {
320320 const { watcher, isRecursive } = addDirWatcher ( dirPath , recursive ) ;
321321 return {
322322 close : ( ) => reduceDirWatcherRefCount ( watcher , dirPath , isRecursive )
323- }
323+ } ;
324324 }
325-
325+
326326 function reduceDirWatcherRefCount ( watcher : DirWatcher , dirPath : Path , isRecursive : boolean ) {
327327 watcher . referenceCount -= 1 ;
328328 if ( watcher . referenceCount <= 0 ) {
329329 watcher . close ( ) ;
330330 if ( isRecursive ) {
331331 recursiveDirWatchers . remove ( dirPath ) ;
332- } else {
332+ }
333+ else {
333334 dirWatchers . remove ( dirPath ) ;
334335 }
335336 }
336337 }
337338
338339 function addDirWatcher ( dirPath : Path , recursive ?: boolean ) : { watcher : DirWatcher , isRecursive : boolean } {
339340 let watchers : FileMap < DirWatcher > ;
340- let options : { persistent : boolean , recursive ?: boolean } = { persistent : true } ;
341+ const options : { persistent : boolean , recursive ?: boolean } = { persistent : true } ;
341342
342343 // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows
343344 // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643)
344345 if ( isNode4OrLater ( ) && recursive === true ) {
345346 if ( recursiveDirWatchers . contains ( dirPath ) ) {
346- const watcher = recursiveDirWatchers . get ( dirPath ) ;
347+ const watcher = recursiveDirWatchers . get ( dirPath ) ;
347348 watcher . referenceCount += 1 ;
348349 return { watcher, isRecursive : true } ;
349350 }
350351 watchers = recursiveDirWatchers ;
351352 options . recursive = true ;
352- } else {
353+ }
354+ else {
353355 if ( dirWatchers . contains ( dirPath ) ) {
354356 const watcher = dirWatchers . get ( dirPath ) ;
355357 watcher . referenceCount += 1 ;
@@ -391,7 +393,8 @@ namespace ts {
391393 const { watcher } = findDirWatcherForFile ( filePath ) ;
392394 if ( ! watcher ) {
393395 addDirWatcher ( getDirectoryPath ( filePath ) ) ;
394- } else {
396+ }
397+ else {
395398 watcher . referenceCount += 1 ;
396399 }
397400 fileWatcherCallbacks . set ( filePath , callback ) ;
0 commit comments