0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-03-25 02:32:52 -05:00

Merge pull request #152 from Verikon/master

Allows retrieval of all local package contents via http://server/-/search/~
This commit is contained in:
jotadeveloper 2017-04-12 06:27:27 +02:00 committed by GitHub
commit ee2439d8da

View file

@ -12,7 +12,9 @@ function Search() {
}
Search.prototype.query = function(q) {
return this.index.search(q)
return q === '*'
? this.storage.config.localList.get().map( function( package ){ return { ref: package, score: 1 }; } )
: this.index.search(q);
}
Search.prototype.add = function(package) {
@ -45,4 +47,3 @@ Search.prototype.configureStorage = function(storage) {
}
module.exports = Search()