kentcdodds / match-sorter

Simple, expected, and deterministic best-match sorting of an array in JavaScript

Home Page:https://npm.im/match-sorter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiple priority sort Issue

mohak1990 opened this issue · comments

matchSorter(arr, "t", {keys: ["Name","Surname"]})

In this case if both Name and Surname has "t", still it returns an empty string.
It works if any one of the 2 cases are passed.
Expected:
The return array should be a sorted one having "t" in any of the 2 cases(or both, but giving sort priority "Name")

According to the tests and a test I ran myself just now, this works fine.
Test for key priority

Maybe it would be nice to see the full code with the array supplied or perhaps a different example, to make sure?

Sorry, I missed quotes for each case. Thanks