EthanRutherford/fast-fuzzy

Feature request: option to return unsorted results

AlexVipond opened this issue · 4 comments

I'm using fast-fuzzy to handle the search feature for a custom listbox I'm building, and my implementation needs the match data search results to retain the original order of the listbox options.

Proposal: add a sort boolean option to searchCore. It should default to true so that it's not a breaking change, but it could be set to false to return search results in their original order.

search('my query', { sort: false })

Let me know your thoughts @EthanRutherford—I'm happy to PR the feature and take a stab at some tests

This is a great request, and should be fairly straightforward to add. I could probably take care of this pretty quickly.

Thanks for the request, this was added in fe56314 and published with version 1.11.0.

Thanks, this is great!

I'm getting an error during TypeScript compilation for this semicolon:

Seems like it's just a case where semicolons are not allowed. Compilation runs normally as soon as the semicolon is removed.

Oh, yeah sorry I don't work in typescript all that often, I should probably add something to validate that d.ts file so this kind of thing doesn't happen again. I'll get that fixed, and a patch version shipped.