Skip to content

Commit

Permalink
Merge pull request #345 from ImTheTom/update-collectionKeyBy
Browse files Browse the repository at this point in the history
update collectionKeyBy so it works for objects
  • Loading branch information
stevemao committed Aug 18, 2022
2 parents 1b20bf9 + 787bf02 commit 0dc3861
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,7 @@ Creates an object composed of keys generated from the results of running each el
// keyBy for array and object
const collectionKeyBy = (collection, key) => {
const c = collection || {};
return c.isArray() ? keyBy(c, key) : Object.values(keyBy(c, key));
return c.isArray() ? keyBy(c, key) : keyBy(Object.values(c), key);
}
```

Expand Down

0 comments on commit 0dc3861

Please sign in to comment.