fast-glob
fast-glob copied to clipboard
Inconsistent file count
Environment
- OS Version: Windows 11 Pro 23H2
- Node.js Version: 22.1.0
Actual behavior
When I glob a dir for files, I am getting a wildly different number of paths returned on every sequential call.
Expected behavior
fast-glob returns all the files, the same count every time.
Steps to reproduce
- FG a large dir
- Repeat
- Compare
Code sample
const fileTypes = [
'flac',
'mp3',
'ogg',
'wav',
'aac',
'm4a',
]
const glob = (path) => (cwd) => fg(path, { cwd, caseSensitiveMatch: false, onlyFiles: true })
const findTracks = glob(`**/*.{${fileTypes.join(',')}}`)
findTracks("D:/media/music").then(e=>console.log(e.length))
// 4577
findTracks("D:/media/music").then(e=>console.log(e.length))
// 4507
findTracks("D:/media/music").then(e=>console.log(e.length))
// 4545