-
Notifications
You must be signed in to change notification settings - Fork 136
Open
Description
Environment
- OS Version: Windows 10 22H2
- Node.js Version: 22.8.0
Actual behavior
it looks like fast-glob has inconsistent behavior around trailing / in patterns and the behavior of only returning directories is only present if the pattern is dynamic (and otherwise fast-glob matches files too). in both glob and fs.glob, only directories are returned if the pattern ends with a /
Expected behavior
fast-glob only returns directories if the pattern ends with / even if it's a dynamic pattern
Steps to reproduce
- use a dynamic pattern that ends with
/(it only returns directories) - use a static pattern that refers to a file and ends with
/(it matches the file)
Code sample
import glob from 'fast-glob';
// dynamic pattern, only returns folders so no files are matched
await glob(['*.ts/'], {
onlyFiles: false
});
// static pattern, returns files too
await glob(['index.ts/'], {
onlyFiles: false
});kahagerman, OleSkaar and sheremet-va
Metadata
Metadata
Assignees
Labels
No labels