Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix _.maxBy and _.minBy #4233

Merged
merged 1 commit into from
Mar 12, 2019
Merged

Conversation

gu-xionghong
Copy link
Contributor

In the master, the _.maxBy and _.minBy will work like this:

const objects = [{ n: 1 }, { n: 3 }, { n: 2 }];

_.maxBy(objects, ({n}) => n)
// expect {n: 3}, but return {n: 2}

_.minBy(objects, ({n}) => n)
// expect {n: 1}, but return {n: 2}

@jdalton jdalton added the bug label Mar 12, 2019
@jdalton jdalton merged commit c541e4c into lodash:master Mar 12, 2019
@jdalton
Copy link
Member

jdalton commented Mar 12, 2019

Thanks @gu-xionghong!

@gu-xionghong gu-xionghong deleted the gu-xionghong/maxBy&minBy branch March 12, 2019 06:04
@falsyvalues
Copy link
Contributor

Does tests pass before this change? Maybe we should add more if so.

@gu-xionghong
Copy link
Contributor Author

Hi, @falsyvalues , I found that after this commit which removes the baseIteratee, the master branch can't be passed the tests. But the other branches always keep the different version, and they can be passed the tests.

@lock
Copy link

lock bot commented Mar 18, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Mar 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

3 participants