File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -16,11 +16,6 @@ export class Glob {
16
16
matches ( name : string ) {
17
17
let segments = name . split ( '.' ) ;
18
18
19
- // match single stars
20
- for ( let i = 0 , l = this . glob . length ; i < l ; i ++ ) {
21
- if ( this . glob [ i ] === '*' ) segments [ i ] = '*' ;
22
- }
23
-
24
19
// match greedy starts
25
20
if ( this . glob [ 0 ] === '**' ) {
26
21
segments = segments . slice ( segments . indexOf ( this . glob [ 1 ] ) ) ;
@@ -31,6 +26,12 @@ export class Glob {
31
26
segments . splice ( segments . indexOf ( this . glob [ this . glob . length - 2 ] ) + 1 , Number . MAX_VALUE ) ;
32
27
segments . push ( '**' ) ;
33
28
}
29
+
30
+ // match single stars
31
+ for ( let i = 0 , l = this . glob . length ; i < l ; i ++ ) {
32
+ if ( this . glob [ i ] === '*' && segments . length > i ) segments [ i ] = '*' ;
33
+ }
34
+
34
35
if ( this . glob . length != segments . length ) return false ;
35
36
36
37
return segments . join ( '' ) === this . glob . join ( '' ) ;
You can’t perform that action at this time.
0 commit comments