krisk / Fuse

Lightweight fuzzy-search, in JavaScript
https://fusejs.io/
Apache License 2.0
18.44k stars 774 forks source link

Clarify input to Fuse.parseIndex #782

Open dbaynard opened 1 month ago

dbaynard commented 1 month ago

It is not obvious how to use Fuse.parseInput, and if supplied an incorrect argument it errs, silently.

  1. Narrowing the type clarifies intent (in code and in editor integrations).
  2. Documentation gives a further clarifying example.

This fixes the issues that led to #524 and #624 and my losing more time than I'd have liked on this otherwise excellent library!

I'm Creating as a draft because it doesn't yet meet contributing guidelines.