We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fuse.search
unknown
2e60bee changed the signature of Fuse.prototype.search.
Fuse.prototype.search
search<T>( pattern: string | Fuse.Expression, options?: Fuse.FuseSearchOptions ): Fuse.FuseResult<T>[]
Here T isn't constrained by any of the arguments. Therefore it defaults to unknown, making it meaningless.
T
I guess search<T>(...) was meant to be search(...), using T from the outer Fuse<T>?
search<T>(...)
search(...)
Fuse<T>
Fuse 6.4.5
Yes. Previously the type parameter was named R and was defaulted to T from the outer class Fuse<T>.
R
declare const fuse: Fuse<{ id: number }>; const matchedIds = fuse.search("").map(res => res.item.id);
The text was updated successfully, but these errors were encountered:
@qnighy @krisk, to resolve the issue where the type is lost and defaults to unknown, I had to the following - using the minimal reproduction above:
type K = { id: number } declare const fuse: Fuse<K>; const matchedIds = fuse.search<K>("").map(res => res.item.id); // <-- notice the type parameter in `search<K>`
This was not the case before and the fix pointed by @qnighy should solve this.
I guess search(...) was meant to be search(...), using T from the outer Fuse?
Sorry, something went wrong.
Good catch. Will fix.
94766b2
Thanks!
Successfully merging a pull request may close this issue.
Describe the bug
2e60bee changed the signature of
Fuse.prototype.search
.Here
T
isn't constrained by any of the arguments. Therefore it defaults tounknown
, making it meaningless.I guess
search<T>(...)
was meant to besearch(...)
, usingT
from the outerFuse<T>
?Version
Fuse 6.4.5
Is this a regression?
Yes. Previously the type parameter was named
R
and was defaulted toT
from the outer classFuse<T>
.🔬Minimal Reproduction
Additional context
The text was updated successfully, but these errors were encountered: