terkelg / tiny-glob

Super tiny and ~350% faster alternative to node-glob
MIT License
856 stars 25 forks source link

Fix bug relating to use of relative paths in CACHE #83

Closed aomarks closed 1 month ago

aomarks commented 2 years ago

The CACHE object is used to remember whether a path was a directory or not across glob() calls. Previously, this cache was keyed by the relative path of the file (i.e. the basename).

This can result in missing results (not descending into a directory because it was incorrectly thought to be a file), or an exception (attempting to descend into a file because it was thought to be a directory).

Now, the CACHE object is instead keyed by the full path, instead of the relative path.