-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Base sort should still be applied if the search string is empty #100
Labels
Comments
Thanks for the issue Rebecca. I agree with you. Would you be willing to make a pull request to add this functionality (and fix the README too)? |
RebeccaStevens
pushed a commit
to RebeccaStevens/match-sorter
that referenced
this issue
Sep 14, 2020
4 tasks
Made the PR :) |
kentcdodds
pushed a commit
that referenced
this issue
Sep 14, 2020
* fix: still sort when search value is absent fix #100 * docs: add RebeccaStevens as a contributor
kentcdodds
added a commit
that referenced
this issue
Sep 14, 2020
* fix: still sort when search value is absent fix #100 * docs: add RebeccaStevens as a contributor * docs: adjust example in the readme to apply the base sort * docs: add doc contribution to RebeccaStevens Co-authored-by: Kent C. Dodds <[email protected]>
🎉 This issue has been resolved in version 4.2.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
match-sorter
version: 4.2.0node
version: 14.8.0npm
(oryarn
) version: 6.14.7 (or 1.21.1 😛)Relevant code or config
What you did:
What happened:
The list was returned unsorted.
Problem description:
As no search string was supplied, all items should have the same ranking, therefore the base sort should be applied as the tie-breaker. i.e. The list should be sorted but it's not.
Suggested solution:
If the search string is empty, apply the base sort instead of just returning the list unsorted.
Additional Note:
I stole the "Relevant code" from the Usage section of the Read Me. When I did, I noticed that it's slightly out of date now as the base sort is not be applied to the output.
matchSorter(list, 'h') // ['hi', 'hey', 'hello']
should bematchSorter(list, 'h') // [ 'hello', 'hey', 'hi' ]
The text was updated successfully, but these errors were encountered: