krisk / Fuse

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

fix: FuseSortFunctionMatch typescript types #665

Closed hoonoh closed 7 months ago

hoonoh commented 2 years ago

Relates to #613

Fixes typing on FuseSortFunctionMatch, mainly on key & indices attribute. I included typings test which triggers searchFn with and without includeMatches option, which when undefined, the indices attribute type is also undefined. I am not sure if this change should bring any side effects, or if the typing on FuseSortFunctionMatch should be different when Fuse constructor is given different option combinations from the ones in the added tests.

krisk commented 2 years ago

Thanks for the PR! Let me dig into this a bit more. Want to ensure there is no side effect.