99import * as fs from 'fs' ;
1010import * as path from 'path' ;
1111import { EventEmitter } from 'events' ;
12- import anymatch from 'anymatch' ;
13- import { some as micromatchSome } from 'micromatch' ;
12+ import anymatch , { Matcher } from 'anymatch' ;
13+ import micromatch from 'micromatch' ;
1414// eslint-disable-next-line
1515import { Watcher } from 'fsevents' ;
1616// @ts -ignore no types
@@ -40,7 +40,7 @@ type FsEventsWatcherEvent =
4040 */
4141class FSEventsWatcher extends EventEmitter {
4242 public readonly root : string ;
43- public readonly ignored ?: anymatch . Matcher ;
43+ public readonly ignored ?: Matcher ;
4444 public readonly glob : Array < string > ;
4545 public readonly dot : boolean ;
4646 public readonly hasIgnore : boolean ;
@@ -65,7 +65,7 @@ class FSEventsWatcher extends EventEmitter {
6565 fileCallback : ( normalizedPath : string , stats : fs . Stats ) => void ,
6666 endCallback : Function ,
6767 errorCallback : Function ,
68- ignored ?: anymatch . Matcher ,
68+ ignored ?: Matcher ,
6969 ) {
7070 walker ( dir )
7171 . filterDir (
@@ -83,7 +83,7 @@ class FSEventsWatcher extends EventEmitter {
8383 dir : string ,
8484 opts : {
8585 root : string ;
86- ignored ?: anymatch . Matcher ;
86+ ignored ?: Matcher ;
8787 glob : string | Array < string > ;
8888 dot : boolean ;
8989 } ,
@@ -139,8 +139,8 @@ class FSEventsWatcher extends EventEmitter {
139139 return false ;
140140 }
141141 return this . glob . length
142- ? micromatchSome ( relativePath , this . glob , { dot : this . dot } )
143- : this . dot || micromatchSome ( relativePath , '**/*' ) ;
142+ ? micromatch ( [ relativePath ] , this . glob , { dot : this . dot } ) . length > 0
143+ : this . dot || micromatch ( [ relativePath ] , '**/*' ) . length > 0 ;
144144 }
145145
146146 private handleEvent ( filepath : string ) {
0 commit comments