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

feat: return matched pos

Akimotorakiyu opened this issue · comments

commented

use case:
list: [{name:'hello'},{name:'other'}]
input: e
matched: [{name:'hello'},{name:'other'}]

when should highlight the matched char, we need pos of matched char to do that

h e🍺 llo
oth e🍺 r
thanks!

Unfortunately this would require a significant overhaul of the library that I'm not sure we should do. I believe there are other libraries that do this. I'm not sure what they are. Sorry, but I don't think we'll support this here.