ninja-keys
ninja-keys copied to clipboard
Command fuzzy matching
Allow commands to be fuzzy-matched when searching (with something like https://github.com/farzher/fuzzysort, but not necessarily it).
Potentially also allow typos. e.g. for command named Open
allow searching using Opne
(within a threshold)
Thanks for suggestion! Yea, sounds as a good feature.
I will add this functionality, but need to check if there are other smaller libs or implement it inside. Because I don't want to grow dependencies a lot or at least want to keep size small.
So, if you or anyone have other suggestions for libs/repos, drop a link here. Cheers!
@ssleptsov as a potential workaround, as to not have this built in - you could expose a matcher function (passed in a similar way to the commands I guess? I'm not super familiar with Web Components, but I assume you can't pass non-seriazable things using attributes) and let the consumer optionally provide it, having them bear the bundle size increase.
Default would be the current regex matching that's done.
Having said that, I think since you may also want a different order for results, that might have to be exposed via the same (?) api as well.
Kbar uses this internally https://github.com/superhuman/command-score
