You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 1, 2023. It is now read-only.
Use case:
Instead of wanting to compare ["foo","bar","baz"], it can be useful to pass in an array of objects for which you want to compare one property, i.e.
This use case is too specific and too easily adapted to work with the existing interface of the library. What if I wanted it to return the index instead of the property? Or wanted it to select a key on an object within an object within the root-level list?
To adapt the existing interface to operate on this data, you could wrap it in a function:
If you really can't afford the slight performance loss in creating an extra list and iterating an extra time (which is unlikely, this is JS, and the findBestMatch function does a lot more work than the aforementioned additional work), then I would advise just copying the code or forking the project. It is MIT.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Use case:
Instead of wanting to compare
["foo","bar","baz"]
, it can be useful to pass in an array of objects for which you want to compare one property, i.e.and instruct the function to compare based on the
name
property, but return the whole object in the response.I have already created a PR #124 for this. Just need approval
The text was updated successfully, but these errors were encountered: