search now accepts a tilda to list all contents of the local package list
This commit is contained in:
parent
8c2329795d
commit
71d5e5f150
|
@ -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()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue