Open shannonmoeller opened 10 years ago
Multiple args for deep index, a la plucks
.
https://github.com/shannonmoeller/mtil/issues/1#issuecomment-41986348
What if lookups are not unique? Make an array?
Maybe we want a separate groupsBy
or something that will deal with this.
It also seems like this function would never be used outside of reduce due to its funky arguments signature. Maybe not a big deal, idk.
We could create the object if it doesn't exist, so that the signature is consistent:
records.reduce(toLookup('id'));
Converts an array to an object indexed by a particular key.