micromatch/picomatch

Implementation of basename and matchBase options to not match documentation

pskfyi opened this issue · 1 comments

The basename option description reads, with my emphasis:

If set, then patterns without slashes will be matched against the basename of the path if it contains slashes. For example, a?b would match the path /xyz/123/acb, but not /xyz/acb/123.

This description appears to be copied from minimatch, however the behavior does not match this description. Enabling the option causes patterns with slashes to also be handled in the same manner as those without slashes.

I've captured the issue with working example here: https://github.com/pskfyi/picomatch-basename-issue

I discovered this when trying to migrate from minimatch to picomatch, and it is inhibiting my ability to migrate cleanly. It seems to me that the docs are wrong, or this is a bug from your perspective, or I am missing something. If this is indeed a bug I'm willing to take a whack at submitting a PR.

Confirmed on picomatch v2.3.1.