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

No matches when apostrophe mismatch

alexandernanberg opened this issue · comments

  • match-sorter version: 6.3.0
  • node version: N/A

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

Hi @alexandernanberg,

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