UNPKG

wrap-git

Version:

Wraps GitHub profile and provides summarized details about repos, commits and language coverages for a given profile.

9 lines (8 loc) 301 B
export const sortReposByStars = (repos) => { return repos.sort((a, b) => { if (b.stargazers_count !== a.stargazers_count) { return b.stargazers_count - a.stargazers_count; } return new Date(b.updated_at).getTime() - new Date(a.updated_at).getTime(); }); };