1
1
import chalk from 'chalk' ;
2
2
import { readdirSync , readFileSync , statSync } from 'fs' ;
3
- import minimatch from 'minimatch' ;
3
+ import { Minimatch } from 'minimatch' ;
4
4
import { join } from 'path' ;
5
5
6
6
/**
@@ -23,7 +23,7 @@ const ownedPaths = readFileSync(ownersFilePath, 'utf8')
23
23
// Split off just the path glob.
24
24
. map ( line => line . split ( / \s + / ) [ 0 ] )
25
25
// Turn paths into Minimatch objects.
26
- . map ( path => new minimatch . Minimatch ( path , { dot : true , matchBase : true } ) ) ;
26
+ . map ( path => new Minimatch ( path , { dot : true , matchBase : true } ) ) ;
27
27
28
28
const ignoredPaths = readFileSync ( gitIgnorePath , 'utf8' )
29
29
. split ( '\n' )
@@ -32,7 +32,7 @@ const ignoredPaths = readFileSync(gitIgnorePath, 'utf8')
32
32
// Remove empty lines and comments.
33
33
. filter ( line => line && ! line . startsWith ( '#' ) )
34
34
// Turn paths into Minimatch objects.
35
- . map ( path => new minimatch . Minimatch ( path , { dot : true , matchBase : true } ) ) ;
35
+ . map ( path => new Minimatch ( path , { dot : true , matchBase : true } ) ) ;
36
36
37
37
for ( let paths = getChildPaths ( '.' ) ; paths . length ; ) {
38
38
paths = Array . prototype . concat (
@@ -72,7 +72,7 @@ if (errors) {
72
72
}
73
73
74
74
/** Check if the given path is owned by the given owned path matcher. */
75
- function isOwnedBy ( path : string , ownedPath : minimatch . IMinimatch ) {
75
+ function isOwnedBy ( path : string , ownedPath : Minimatch ) {
76
76
// If the owned path ends with `**` its safe to eliminate whole directories.
77
77
if ( ownedPath . pattern . endsWith ( '**' ) || statSync ( path ) . isFile ( ) ) {
78
78
return ownedPath . match ( '/' + path ) ;
0 commit comments