mattyork / fuzzy

Filters a list based on a fuzzy string search

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use object of objects instead of an array

hugohow opened this issue · comments

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 !

Nope.

But you can convert the object into an array:

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