sindresorhus / globby

User-friendly glob matching
MIT License
2.49k stars 126 forks source link

Pass deep option to ignore filter to avoid unnecessary recursion #251

Closed fwouts closed 1 year ago

fwouts commented 1 year ago

When globbing through a very large directory, it's useful to use the deep option from fast-glob to stop at a maximum level of depth: https://github.com/mrmlnc/fast-glob#deep

However when using gitignore: true, the lookup for ignored files doesn't currently pass the deep option, meaning that we still go through every level of the directory.

This PR forwards the deep option to make it work as expected.