Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion misc/keyvaluestorage/src/browser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class KeyValueStorage implements IKeyValueStorage {
return this.storage.getKeys();
}

public async getEntries<T = any>(): Promise<[string, T][]> {
public async getEntries(): Promise<[string, unknown][]> {
await this.initialize();
return this.storage.getEntries();
}
Expand Down
4 changes: 2 additions & 2 deletions misc/keyvaluestorage/src/browser/lib/indexedDb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ export class IndexedDb implements IKeyValueStorage {
return this.indexedDb.getKeys();
}

public async getEntries<T = any>(): Promise<[string, T][]> {
public async getEntries(): Promise<[string, unknown][]> {
const entries = await this.indexedDb.getItems(await this.indexedDb.getKeys());
return entries.map((item: any) => [item.key, item.value] as [string, T]);
return entries.map((item: any) => [item.key, item.value]);
}

public async getItem<T = any>(key: string): Promise<T | undefined> {
Expand Down
2 changes: 1 addition & 1 deletion misc/keyvaluestorage/src/browser/lib/localStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class LocalStore implements IKeyValueStorage {
return Object.keys(this.localStorage);
}

public async getEntries<T = any>(): Promise<[string, T][]> {
public async getEntries(): Promise<[string, unknown][]> {
return Object.entries(this.localStorage).map(parseEntry);
}

Expand Down
2 changes: 1 addition & 1 deletion misc/keyvaluestorage/src/node-js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class KeyValueStorage implements IKeyValueStorage {
return this.database.getKeys();
}

public async getEntries<T = any>(): Promise<[string, T][]> {
public async getEntries(): Promise<[string, unknown][]> {
await this.initialize();
return this.database.getEntries();
}
Expand Down
4 changes: 2 additions & 2 deletions misc/keyvaluestorage/src/node-js/lib/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ export default class Db {
return this.database.getKeys();
}

public async getEntries<T = any>(): Promise<[string, T][]> {
public async getEntries(): Promise<[string, unknown][]> {
const entries = await this.database.getItems(await this.database.getKeys());
return entries.map((item: any) => [item.key, item.value] as [string, T]);
return entries.map((item: any) => [item.key, item.value]);
}

private async onWriteAction(params: {
Expand Down
2 changes: 1 addition & 1 deletion misc/keyvaluestorage/src/react-native/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class KeyValueStorage implements IKeyValueStorage {
return this.asyncStorage.getAllKeys() as Promise<string[]>;
}

public async getEntries<T = any>(): Promise<[string, T][]> {
public async getEntries(): Promise<[string, unknown][]> {
const keys = await this.getKeys();
const entries = await this.asyncStorage.multiGet(keys);
return entries.map(parseEntry);
Expand Down
2 changes: 1 addition & 1 deletion misc/keyvaluestorage/src/shared/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export interface KeyValueStorageOptions {

export abstract class IKeyValueStorage {
public abstract getKeys(): Promise<string[]>;
public abstract getEntries<T = any>(): Promise<[string, T][]>;
public abstract getEntries(): Promise<[string, unknown][]>;
public abstract getItem<T = any>(key: string): Promise<T | undefined>;
public abstract setItem<T = any>(key: string, value: T): Promise<void>;
public abstract removeItem(key: string): Promise<void>;
Expand Down