search now accepts a tilda to list all contents of the local package list

This commit is contained in:
Bren Norris 2017-04-09 10:05:31 -04:00
parent 8c2329795d
commit 71d5e5f150
1 changed files with 3 additions and 2 deletions

View File

@ -12,7 +12,9 @@ function Search() {
} }
Search.prototype.query = function(q) { 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) { Search.prototype.add = function(package) {
@ -45,4 +47,3 @@ Search.prototype.configureStorage = function(storage) {
} }
module.exports = Search() module.exports = Search()