krisk/Fuse — pull request #28 by mrkishi (2014-06-20 15:42:50+00:00)
Title: Allow each key to contain multiple values

Hello, everyone,

There is currently no way to use a variable number of search keys per items, because every used key must be defined both in the options and the data.
As a workaround, one could reuse items, each with a different key value, but I find it quite inconvenient.

I've implemented this is very simple change that allows the use of Arrays and Objects for keys, so that each item may have any number of alternatives for its keys.
I found this approach quite useful for synonyms, tags and multi-language action snippets, and hope you find this useful for you as well.

As an example, take a look at the added test: each item may have an unknown number of related keys. They can use a single Array-based key to handle all of the related values.

If this proves to be valuable enough for a merge, I'll gladly try to fix any issues left, so fire away. :)