You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/07/18 08:19:06 UTC

[GitHub] [cordova-android] raphinesse opened a new pull request #788: Simplify apkSorter using compare-func package

raphinesse opened a new pull request #788: Simplify apkSorter using compare-func package
URL: https://github.com/apache/cordova-android/pull/788
 
 
   ### Motivation and Context
   <!-- Why is this change required? What problem does it solve? -->
   <!-- If it fixes an open issue, please link to the issue here. -->
   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
   <!-- Describe your changes in detail -->
   
   
   Implement `apkSorter` in a `sortBy` style using the `compare-func` module.
   
   ### Testing
   <!-- Please describe in detail how you tested your changes. -->
   
   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)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org