Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -313,16 +313,16 @@ <h1>Find Great Open Source Opportunities.</h1>
}

function sortByGoodFirstIssues(repos) {

function compare(a, b) {
return returnComp(a.issues.length, b.issues.length, a.starcount, b.starcount)
};


repos.sort(compare);
return repos;
repos.sort((a, b) => {
if (b.issues.length === a.issues.length) {
return b.starcount - a.starcount; // Tie-breaker
}
return b.issues.length - a.issues.length;
});
return repos;
}


function returnComp(a, b, tiebreaker1, tiebreaker2) {


Expand All @@ -341,15 +341,12 @@ <h1>Find Great Open Source Opportunities.</h1>


function sortByStars(repos) {
function compare(a, b) {
return returnComp(a.starcount, b.starcount, a.issues.length, b.issues.length)
};

repos.sort(compare);
return repos;
repos.sort((a, b) => b.starcount - a.starcount);
return repos;
}



function sortBy(value, repositories) {

switch (value) {
Expand Down