feat: send flag indicating whether array is requested

This commit is contained in:
thecodrr
2020-03-09 12:44:55 +05:00
parent 968faab537
commit 1482440e42
2 changed files with 3 additions and 3 deletions

View File

@@ -8,7 +8,7 @@ export default class Indexer extends Storage {
} }
async init() { async init() {
this.indices = (await this.read(this.type)) || []; this.indices = (await this.read(this.type, true)) || [];
} }
async exists(key) { async exists(key) {

View File

@@ -8,8 +8,8 @@ export default class Storage {
readMulti(keys) { readMulti(keys) {
return this.storage.readMulti(keys); return this.storage.readMulti(keys);
} }
read(key) { read(key, isArray = false) {
return this.storage.read(key); return this.storage.read(key, isArray);
} }
clear() { clear() {
return this.storage.clear(); return this.storage.clear();