-
-
Notifications
You must be signed in to change notification settings - Fork 803
Closed
Description
Version: 3.3.0
Type: Potential Bug
Hi,
With the recent addition of typing to FuseOptions and Fuse nested key search is now giving Typescript compile errors.
The particular culprit is this line in the FuseOptions interface
keys?: (keyof T)[] | { name: keyof T; weight: number }[];An example of how this was used in my application:
fuseOptions: FuseOptions<Template> = {
shouldSort: true,
threshold: 0.6,
keys: [
{ name: 'metadata.title', weight: 0.8 },
{ name: 'metadata.category', weight: 0.1 },
{ name: 'metadata.summary', weight: 0.1 },
],
};Where metadata was a key in template and title is a key in metadata. This is no longer allowed by the interface. As a temporary solution I've included a // @ts-ignore above the fuseOptions definition and functionality is fully #restored.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels