mattyork / fuzzy

Filters a list based on a fuzzy string search
MIT License
831 stars 86 forks source link

Use object of objects instead of an array #31

Closed hugohow closed 7 years ago

hugohow commented 7 years ago

Hello, Thanks for this great library !

Is it possible to use an object like this :

var list = { 1: {id: 1, rompalu: 'baconing', zibbity: 'simba'}, 2: {id: 2, rompalu: 'narwhal' , zibbity: 'mufasa'}, 3: {id: 3, rompalu: 'a mighty bear canoe', zibbity: 'saddam hussein'} }

instead of a list like :

var list = [ {rompalu: 'baconing', zibbity: 'simba'} , {rompalu: 'narwhal' , zibbity: 'mufasa'} , {rompalu: 'a mighty bear canoe', zibbity: 'saddam hussein'} ];

Thanks for the response !

mattyork commented 7 years ago

Nope.

But you can convert the object into an array:

var newList = []; 
for(var x in list) { 
  newList.push(list[x]); 
}