Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@dbaynard
Copy link
Contributor

@dbaynard dbaynard commented Oct 16, 2024

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.

Narrowing the type of the parameter from `any` makes it obvious that the
input is an `Object`, rather than a `String`.

With the `any` type as input, it was not obvious how to use this
function.

See krisk#524 and krisk#624 for people bitten by this.
This takes a javascript `Object`, not a `String`. The difference is
relevant when loading a pre-computed index using a web request, for
example, or when deserializing from OPFS (not shown).
@dbaynard dbaynard marked this pull request as ready for review October 17, 2024 13:27
@krisk krisk merged commit 84b493f into krisk:main Feb 3, 2025
@dbaynard dbaynard deleted the patch-1 branch February 3, 2025 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants