@@ -157,7 +157,7 @@ function workspacePatternToGlobPattern(workspace: string): string {
157157 return `${ workspace } /package.json`
158158}
159159
160- export function filterReportSupportedFiles (
160+ export function filterBySupportedScanFiles (
161161 filepaths : string [ ] | readonly string [ ] ,
162162 supportedFiles : SocketSdkSuccessResult < 'getReportSupportedFiles' > [ 'data' ] ,
163163) : string [ ] {
@@ -191,12 +191,13 @@ export async function globWithGitIgnore(
191191 socketConfig,
192192 ...additionalOptions
193193 } = { __proto__ : null , ...options } as GlobWithGitIgnoreOptions
194- const projectIgnorePaths = socketConfig ?. projectIgnorePaths
194+
195195 const ignoreFiles = await tinyGlob ( [ '**/.gitignore' ] , {
196196 absolute : true ,
197197 cwd,
198198 expandDirectories : true ,
199199 } )
200+ const projectIgnorePaths = socketConfig ?. projectIgnorePaths
200201 const ignores = [
201202 ...ignoredDirPatterns ,
202203 ...( Array . isArray ( projectIgnorePaths )
@@ -220,25 +221,31 @@ export async function globWithGitIgnore(
220221 ]
221222 const hasNegatedPattern = ignores . some ( p => p . charCodeAt ( 0 ) === 33 /*'!'*/ )
222223 const globOptions = {
224+ __proto__ : null ,
223225 absolute : true ,
224226 cwd,
225227 dot : true ,
226228 expandDirectories : false ,
227229 ignore : hasNegatedPattern ? [ ] : ignores ,
228230 ...additionalOptions ,
229231 }
232+
230233 const result = await tinyGlob ( patterns as string [ ] , globOptions )
231234 if ( ! hasNegatedPattern ) {
232235 return result
233236 }
234- const { absolute } = globOptions
235237
236238 // Note: the input files must be INSIDE the cwd. If you get strange looking
237239 // relative path errors here, most likely your path is outside the given cwd.
238240 const filtered = ignore ( )
239241 . add ( ignores )
240- . filter ( absolute ? result . map ( p => path . relative ( cwd , p ) ) : result )
241- return absolute ? filtered . map ( p => path . resolve ( cwd , p ) ) : filtered
242+ . filter (
243+ globOptions . absolute ? result . map ( p => path . relative ( cwd , p ) ) : result ,
244+ )
245+
246+ return globOptions . absolute
247+ ? filtered . map ( p => path . resolve ( cwd , p ) )
248+ : filtered
242249}
243250
244251export async function globNodeModules ( cwd = process . cwd ( ) ) : Promise < string [ ] > {
0 commit comments