GitShow/kentcdodds/match-sorter
kentcdodds

match-sorter

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

by kentcdodds
Star on GitHubForkWebsitenpm

TypeScript

4.1k stars143 forks49 contributorsQuiet · 3mo agoSince 2016v8.3.0MIT

Meet the team

See all 49 on GitHub →
allcontributors[bot]Bot
allcontributors[bot]21 contributions
kentcdodds
kentcdodds14 contributions
MichaelDeBoey
MichaelDeBoey4 contributions
ChrisRu
ChrisRu3 contributions
bernharduw
bernharduw2 contributions
conorhastings
conorhastings2 contributions
nfdjps
nfdjps2 contributions
Raghuboi
Raghuboi2 contributions

Languages

View on GitHub →
TypeScript99.7%
JavaScript0.3%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

6 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct✓Issue Template✓PR Template

Recent PRs & issues

Quiet · 5 discussions · Last activity 3mo ago
See all on GitHub →
KubaJastrz
Q: Why direct dependency on @babel/runtime?OpenIssue

What is used here for? https://github.com/kentcdodds/match-sorter/blob/9a409761194797f98b77e939b405049433b289b3/package.json#L30

KubaJastrz · 11mo ago

Recent fixes

View closed PRs →
justinwaite
Feature Request: Optionally return rank metadata in the result of the matchSorter functionClosedIssue

I want to be able to optionally capture the information about how each item was matched/ranked in the return result of Use case I have a combobox with items that are filtered/sorted using . We want to add the ability for a user to create a custom item in the combobox for items that do not exist. The option to create the custom item should only appear if there are no matches that are above a certain rank. Proposed API If is true, the result is a rather than Type safety can be achieved elegantly using function overloading Alternatives I could run matchSorter twice, once with set to and once with it set to . This would allow me to continue to filter the combobox, while checking to see if the result with set to returned any results. This obviously comes at the cost of filtering twice.

justinwaite · 4mo ago
justinwaite
feat: expose rank info in resultsMergedPR

What: Allow callers to opt into match metadata so they can use ranking details without reimplementing the sorter. Why: For cases when you want to use matchSort but need to save/extract information about how each item was ranked after matchSort runs. How: Added a new option called and an overload for matchSorter. When is true, the return type is but when false it is still just Checklist: [x] Documentation [x] Tests [x] Ready to be merged Summary by CodeRabbit New Features Added a new function that returns matched items with ranking metadata (item, rankedValue, rank, keyIndex, keyThreshold, index). Documentation README updated with usage examples showing the new ranked-item output and improved code formatting in examples. Tests Added tests verifying the ranked-item output structure, ordering, and behavior both with and without options. Refactor Core matching now centralizes ranking so existing match results continue to work while enabling the new ranked-output function.

justinwaite · 4mo ago
kentcdodds
Update to use trusted publishersClosedIssue

Review and modernize this repository’s GitHub Actions workflows to comply with the [2025 npm authentication and token management changes](https://github.blog/changelog/2025-09-29-strengthening-npm-security-important-changes-to-authentication-and-token-management/). Focus only on updating workflow steps and permissions, not environment configuration or unrelated logic. Specifically: 1. Upgrade all steps to the latest major version (currently ). 2. Upgrade all steps to the latest major version (currently ). 3. Update values to the current LTS (currently ). 4. Upgrade to the latest major version (currently ). 5. Update the input to the current major (currently ). 6. Remove all references to , as npm releases now use GitHub’s OIDC authentication for provenance. 7. Add explicit permissions to the semantic-release job: Do not modify other permissions, secrets, job logic, or environment blocks unrelated to these security and release changes.

kentcdodds · 8mo ago
Structured data for AI agents

Repository: kentcdodds/match-sorter. Description: Simple, expected, and deterministic best-match sorting of an array in JavaScript Stars: 4103, Forks: 143. Primary language: TypeScript. Languages: TypeScript (99.7%), JavaScript (0.3%). License: MIT. Homepage: https://npm.im/match-sorter Latest release: v8.3.0 (4mo ago). Open PRs: 0, open issues: 5. Last activity: 3mo ago. Community health: 85%. Top contributors: allcontributors[bot], kentcdodds, MichaelDeBoey, ChrisRu, bernharduw, conorhastings, nfdjps, Raghuboi, RebeccaStevens, sdbrannum and others.

·@ofershap

Replace github.com with gitshow.dev