Skip to content

Commit 08f929a

Browse files
committed
Add code comments
1 parent 18e3341 commit 08f929a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/utils/glob.mts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ export async function globWithGitIgnore(
233233

234234
let hasNegatedPattern = false
235235
for (const p of ignores) {
236-
if (p.charCodeAt(0) === 33) {
236+
if (p.charCodeAt(0) === 33 /*'!'*/) {
237237
hasNegatedPattern = true
238238
break
239239
}
@@ -252,8 +252,10 @@ export async function globWithGitIgnore(
252252
return await glob(patterns as string[], globOptions)
253253
}
254254

255-
const ig = ignore().add([...ignores])
255+
// Add support for negated "ignore" patterns which many globbing libraries,
256+
// including 'fast-glob', 'globby', and 'tinyglobby', lack support for.
256257
const filtered: string[] = []
258+
const ig = ignore().add([...ignores])
257259
const stream = globStream(
258260
patterns as string[],
259261
globOptions,

0 commit comments

Comments
 (0)