mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-20 22:52:46 -05:00
Merge pull request #308 from 7eggs/ui-sort-packages
Sort packages before rendering in UI
This commit is contained in:
commit
4be7a2028e
1 changed files with 9 additions and 0 deletions
|
@ -55,6 +55,15 @@ module.exports = function(config, auth, storage) {
|
|||
})
|
||||
})
|
||||
}, function(packages) {
|
||||
packages.sort(function(p1, p2) {
|
||||
if (p1.name < p2.name) {
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
return 1;
|
||||
}
|
||||
});
|
||||
|
||||
next(template({
|
||||
name: config.web && config.web.title ? config.web.title : 'Sinopia',
|
||||
packages: packages,
|
||||
|
|
Loading…
Add table
Reference in a new issue