Skip to content

Implementation of basename and matchBase options to not match documentation  #89

@pskfyi

Description

@pskfyi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions