Skip to content

Higher score to filename matches #100

Open
@viveksjain

Description

Thanks for this great library, it's really fast!

Summary

Prioritize (either by default or with some option) matches in the filename (i.e. not any of the folders/rest of path).

Additional context

Simple example:

> const zadeh = require('zadeh')
undefined
> zadeh.filter(['foo/bar/baz_qux.js', 'foo/bazqux/a.js'], 'bazqux')
Zadeh: deprecated function. Use 'StringArrayFilterer' instead
[ 'foo/bazqux/a.js', 'foo/bar/baz_qux.js' ]

In my usage, I would generally actually prefer the result for baz_qux.js because I remember and search mostly based on filename.

I do see useExtensionBonus option, couldn't find any clear documentation on what that actually means but it doesn't seem to make any difference.

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