Hi i need to order the data according to the fuzzy matching of 2 variables
Consider i have a string :"pet" and Amount 50
I have an object array as like below:
[{"des":"permanent","amount":100}, {"des":"petrol","amount":1000}]
I need an array as below
[{"des":"petrol","amount":100}, {"des":"permanent","amount":1000}] if suppose petrol is highest matching also its nearer to the value 50.
I used fuzzy npm package as follows:
var options = {
extract: function(el) { return el.description; }
};
var results = fuzzy.filter(description, res, options);
But here i can check for only string, but how can i do also for amount?? Thanks in advance