Created
May 4, 2020 16:04
-
-
Save gasparportik/0fd444237e2b706b2933ebd0979a16b3 to your computer and use it in GitHub Desktop.
Sort PR files by changes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
const diffCount = (elem) => Number((elem.querySelector('.diffstat').attributes['aria-label']?.value||'0').split(' ')[0]); | |
const files = document.getElementById('files'); | |
Array.from(files.querySelectorAll('.file')).sort((a,b) => (a = diffCount(a),b=diffCount(b),a - b)) | |
.forEach((item) => (item.remove(),files.appendChild(item))); | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment