Display package pages when accessed via old names

This commit is contained in:
Steve Purcell 2014-07-11 14:29:03 +01:00
parent 882e3a4877
commit ab7709dbb6

View file

@ -76,7 +76,12 @@
return packages; return packages;
}; };
var packagesByName = {}; var packagesByName = {};
_.each(packages, function(p) { packagesByName[p.name] = p; }); _.each(packages, function(p) {
packagesByName[p.name] = p;
if(p.oldNames) {
_.each(p.oldNames, function(n) { packagesByName[n] = p; });
}
});
this.packageWithName = function(name) { this.packageWithName = function(name) {
return packagesByName[name]; return packagesByName[name];
}; };