diff --git a/lib/search.js b/lib/search.js index 27d46b1bd..b21fd0dcb 100644 --- a/lib/search.js +++ b/lib/search.js @@ -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() -