Skip to content
This repository has been archived by the owner on May 1, 2023. It is now read-only.

findBestMatch : accept a list of objects #42

Closed
nickperkinslondon opened this issue Jul 16, 2019 · 2 comments
Closed

findBestMatch : accept a list of objects #42

nickperkinslondon opened this issue Jul 16, 2019 · 2 comments

Comments

@nickperkinslondon
Copy link

findBestMatch is really cool, but it could use one extra layer of convenience....

You see...I have an array of objects, and one of the attributes is the string that I am comparing.
I need to find the object from the array with the best matching string.

As it is, I have to extract the strings from all objects, find the best matching string, and then go back and find the object whose string is the best matching string.

It would be easier for me to pass-in the list of objects, along with the name of the attribute, and get back a reference to the best object. I suspect that this pattern of usage might be very common.

Again, this is not a bug, just a suggestion to make the API easier to use.
Thanks for this software -- I am going to use it to solve a tricky problem in converting some very old insurance data.

@TimoKunze
Copy link

I agree. I have the same use-case.

@aceakash
Copy link
Owner

aceakash commented Jan 2, 2020

Hi, sorry, but I'm not inclined towards including that.
Though it would be useful, it's something that should be built by composing this library and whatever logic you require (and even utility functions such as lodash etc).
One of my objectives is to keep the API of this library super simple and stable.

@aceakash aceakash closed this as completed Jan 2, 2020
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants