metonym / format-fuse.js

Utility to format matching fuse.js results for easier text highlighting
MIT License
3 stars 1 forks source link

Seems to break on an array of strings #40

Open chmac opened 1 year ago

chmac commented 1 year ago

Slightly modifying the example from the readme like so:

const results = format([
  {
    item: {
      titles: ["Monster 1959", "Second Title"],
      author: { firstName: "David", lastName: "Maine" },
    },
    matches: [
      {
        indices: [[1, 2]],
        value: "Monster 1959",
        key: "title",
        arrayIndex: 0,
      },
    ],
  },
]);

I think the code doesn't follow the refIndex property from fuse on title.