@@ -19,17 +19,14 @@ import { isErrnoException } from './type-helpers.js'
19
19
*/
20
20
const ignoreByDefault = directories ( )
21
21
22
- /** @type { string[] } */
23
- const GLOB_IGNORE = [
24
- ...ignoreByDefault . map ( item => '**/' + item )
25
- ]
26
-
27
22
/** @type {import('globby').Options } */
28
23
const BASE_GLOBBY_OPTS = {
29
24
absolute : true ,
30
25
expandDirectories : false ,
31
26
gitignore : true ,
32
- ignore : GLOB_IGNORE ,
27
+ ignore : [
28
+ ...ignoreByDefault . map ( item => '**/' + item )
29
+ ] ,
33
30
markDirectories : true ,
34
31
unique : true ,
35
32
}
@@ -120,15 +117,19 @@ export async function mapGlobEntryToFiles (entry, supportedFiles) {
120
117
...BASE_GLOBBY_OPTS ,
121
118
cwd : entry
122
119
} )
123
- } else if ( path . basename ( entry ) === 'package.json' ) {
124
- // If the match is a package.json file, then include it
125
- pkgJSFile = entry
126
- } else if ( micromatch . isMatch ( entry , jsLockFilePatterns ) ) {
127
- jsLockFiles = [ entry ]
128
- pkgJSFile = path . resolve ( path . dirname ( entry ) , 'package.json' )
129
- if ( ! ( await fileExists ( pkgJSFile ) ) ) return [ ]
130
- } else if ( micromatch . isMatch ( entry , pyFilePatterns ) ) {
131
- pyFiles = [ entry ]
120
+ } else {
121
+ const entryFile = path . basename ( entry )
122
+
123
+ if ( entryFile === 'package.json' ) {
124
+ // If the match is a package.json file, then include it
125
+ pkgJSFile = entry
126
+ } else if ( micromatch . isMatch ( entryFile , jsLockFilePatterns ) ) {
127
+ jsLockFiles = [ entry ]
128
+ pkgJSFile = path . resolve ( path . dirname ( entry ) , 'package.json' )
129
+ if ( ! ( await fileExists ( pkgJSFile ) ) ) return [ ]
130
+ } else if ( micromatch . isMatch ( entryFile , pyFilePatterns ) ) {
131
+ pyFiles = [ entry ]
132
+ }
132
133
}
133
134
134
135
// If we will include a package.json file but don't already have a corresponding lockfile, then look for one
0 commit comments