-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
REVIEWED: Directory filter tag #4323
- Loading branch information
Showing
1 changed file
with
5 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
627e76c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, just a heads up on this change:
This might lead to false-positives in very specific circumstances. i.e. if a file extension like ".DIR" or ".DIRXYZ" was passed as a filter, this code would include directories in the result
That is why I included the slash in the first place, since slashes are not allowed to be part of a filename (or extension) on Mac, Linux and Windows. The other fix for this would be properly splitting the filter string and checking each part individually, but that seemed unnecessarily complicated and slow to me.
This is a very synthetic edge case and might never happen in practice, but I wanted to let you know anyway.
627e76c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I considered that case could happen but
DIR
seemed more intuitive and easy to remember for users. I think the chances for that to happen are very low and still, it can be customized to something else if some user hit that case.