Skip to content

Using format option for picomatch.test to match against non-string inputs #151

@inolen

Description

@inolen

Hi, I was trying to use micromatch with the format option to match against a property of an object I was passing. However, I quickly hit a snag due to the first conditional at the top of picomatch.test -

https://github.com/micromatch/picomatch/blob/master/lib/picomatch.js#L116

Is it possible to move that further down in the function, after format (if specified) is applied? The use case seems pretty sane - pass an array of objects to micromatch() with a custom format callback which just grabs a property from the object, and the returned matches are the original objects.

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