Closed higunjan closed 8 years ago
The returned results have an "original" property that will do what you want:
var list = [
{rompalu: 'baconing', zibbity: 'simba'}
, {rompalu: 'narwhal' , zibbity: 'mufasa'}
, {rompalu: 'a mighty bear canoe', zibbity: 'saddam hussein'}
];
var options = {
extract: function(el) { return el.rompalu; }
};
var results = fuzzy.filter('narwhal', list, options);
var matches = results.map(function(el) { return el.original; });
console.log(matches);
// [ { rompalu: 'narwhal', zibbity: 'mufasa' } ]
Hi, I'm using these module with node but I have long JSON Array contain object. I need matched object whole. Like
I have above list of JSON Array and if I pass word
narwhal
than It's return only matched words in Array but I need array of matched object. output like :