kentcdodds / match-sorter

Simple, expected, and deterministic best-match sorting of an array in JavaScript
https://npm.im/match-sorter
MIT License
3.73k stars 129 forks source link

No matches when apostrophe mismatch #127

Closed alexandernanberg closed 3 years ago

alexandernanberg commented 3 years ago

Relevant code or config

import { matchSorter } from "match-sorter"

const items = ["Don’t", "Foo"]

console.log(matchSorter(items, "Don't")) // -> []

What you did:

Search with ' but results contains

What happened:

No results returned

Reproduction repository:

See code above

Problem description:

When an item contains and you query by ' you get no matches.

Suggested solution:

It would be nice if this was handled directly in the lib, but if there is a way of fixing this in the code let me know. Would still be valuable to support this OOTB though imo

kentcdodds commented 3 years ago

Hi @alexandernanberg,

I'm afraid that's out of scope for this package.