Use alphabetically sorted filenames regardless of if DB is sorted or not

This commit is contained in:
MrOtherGuy 2020-06-09 16:15:12 +03:00
parent 89dfae2f88
commit 8923cc560a

View file

@ -6,13 +6,14 @@ function initDB(obj){
DB = obj; DB = obj;
Object.defineProperty(DB,"query",{value:function (q,list){ Object.defineProperty(DB,"query",{value:function (q,list){
let nlist = []; let nlist = [];
for(let key of list || Object.keys(this)){ for(let key of list || this.keys){
if(this[key].includes(q)){ if(this[key].includes(q)){
nlist.push(key) nlist.push(key)
} }
} }
return nlist return nlist
}}); }});
Object.defineProperty(DB,"keys",{value:(Object.keys(DB).sort())});
return true return true
} }