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

Simplify apkSorter using compare-func package #788

Merged
merged 1 commit into from
Jul 18, 2019

Conversation

raphinesse
Copy link
Contributor

Motivation and Context

When reviewing #779 I had a hard time understanding what the behavior of apkSorter was. I find that is a common issue with complex sort callbacks in JavaScript.

IMHO it's often makes for way more readable and less repetitive code to have a sortBy style approach. That's what I implemented in this PR for apkSorter.

Description

Implement apkSorter in a sortBy style using the compare-func module.

Testing

I used the existing unit tests. One of them had to be fixed, since it stubbed fs.statSync incorrectly (mtime is a Date, not a timestamp)

Copy link
Member

@erisu erisu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM

@raphinesse raphinesse merged commit b3b8690 into apache:master Jul 18, 2019
@raphinesse raphinesse deleted the cmp-fn-apk-sort branch July 18, 2019 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants