0
Fork 0
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:
Alex Kocharin 2015-09-27 01:31:48 +03:00
commit 4be7a2028e

View file

@ -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,